Drop python2.6 support in module execution (#76106)

pull/76131/head
Matt Martz 3 years ago committed by GitHub
parent b4cbe1adcf
commit 9b4f9e9fd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
breaking_changes:
- Module Python Dependency - Drop support for Python 2.6 in module execution.

@ -1,15 +1,15 @@
.. _porting_2.13_guide: .. _porting_2.13_guide_core:
************************** *******************************
Ansible 2.13 Porting Guide Ansible-core 2.13 Porting Guide
************************** *******************************
This section discusses the behavioral changes between Ansible 2.12 and Ansible 2.13. This section discusses the behavioral changes between ``ansible-core`` 2.12 and ``ansible-core`` 2.13.
It is intended to assist in updating your playbooks, plugins and other parts of your Ansible infrastructure so they will work with this version of Ansible. It is intended to assist in updating your playbooks, plugins and other parts of your Ansible infrastructure so they will work with this version of Ansible.
We suggest you read this page along with `Ansible Changelog for 2.13 <https://github.com/ansible/ansible/blob/devel/changelogs/CHANGELOG-v2.13.rst>`_ to understand what updates you may need to make. We suggest you read this page along with `ansible-core Changelog for 2.13 <https://github.com/ansible/ansible/blob/devel/changelogs/CHANGELOG-v2.13.rst>`_ to understand what updates you may need to make.
This document is part of a collection on porting. The complete list of porting guides can be found at :ref:`porting guides <porting_guides>`. This document is part of a collection on porting. The complete list of porting guides can be found at :ref:`porting guides <porting_guides>`.
@ -37,7 +37,7 @@ No notable changes
Modules Modules
======= =======
No notable changes * Python 2.7 is a hard requirement for module execution in this release. Any code utilizing ``ansible.module_utils.basic`` will not function with a lower Python version.
Modules removed Modules removed

@ -248,24 +248,16 @@ PERMS_RE = re.compile(r'[^rwxXstugo]')
# Used for determining if the system is running a new enough python version # Used for determining if the system is running a new enough python version
# and should only restrict on our documented minimum versions # and should only restrict on our documented minimum versions
_PY3_MIN = sys.version_info[:2] >= (3, 5) _PY3_MIN = sys.version_info >= (3, 5)
_PY2_MIN = (2, 6) <= sys.version_info[:2] < (3,) _PY2_MIN = (2, 7) <= sys.version_info < (3,)
_PY26 = (2, 6) == sys.version_info[:2]
_PY_MIN = _PY3_MIN or _PY2_MIN _PY_MIN = _PY3_MIN or _PY2_MIN
if not _PY_MIN: if not _PY_MIN:
print( print(
'\n{"failed": true, ' '\n{"failed": true, '
'"msg": "ansible-core requires a minimum of Python2 version 2.6 or Python3 version 3.5. Current version: %s"}' % ''.join(sys.version.splitlines()) '"msg": "ansible-core requires a minimum of Python2 version 2.7 or Python3 version 3.5. Current version: %s"}' % ''.join(sys.version.splitlines())
) )
sys.exit(1) sys.exit(1)
if _PY26:
deprecate(
'ansible-core 2.13 will require Python 2.7 or newer on the target. '
'Current version: %s' % ''.join(sys.version.splitlines()),
version='2.13',
)
# #
# Deprecated functions # Deprecated functions

Loading…
Cancel
Save