Update module_utils.six to latest (#22855)

* Update module_utils.six to latest

We've been held back on the version of six we could use on the module
side to 1.4.x because of python-2.4 compatibility.  Now that our minimum
is Python-2.6, we can update to the latest version of six in
module_utils and get rid of the second copy in lib/ansible/compat.
This commit is contained in:
Toshio Kuratomi 2017-03-23 13:35:05 -07:00 committed by GitHub
commit 2fff690caa
127 changed files with 404 additions and 911 deletions

View file

@ -41,7 +41,7 @@ The following is a list of module_utils files and a general description. The mod
- redhat.py - Functions for modules that manage Red Hat Network registration and subscriptions
- service.py - Contains utilities to enable modules to work with Linux services (placeholder, not in use).
- shell.py - Functions to allow modules to create shells and work with shell commands
- six.py - Module utils for working with the Six python 2 and 3 compatibility library
- six/__init__.py - Bundled copy of the `Six Python library <https://pythonhosted.org/six/>`_ to aid in writing code compatible with both Python 2 and Python 3.
- splitter.py - String splitting and manipulation utilities for working with Jinja2 templates
- urls.py - Utilities for working with http and https requests
- vca.py - Contains utilities for modules that work with VMware vCloud Air

View file

@ -325,20 +325,16 @@ Bundled six
The third-party `python-six <https://pythonhosted.org/six/>`_ library exists
to help projects create code that runs on both Python-2 and Python-3. Ansible
includes version 1.4.1 in module_utils so that other modules can use it
includes a version of the library in module_utils so that other modules can use it
without requiring that it is installed on the remote system. To make use of
it, import it like this::
from ansible.module_utils import six
.. note:: Why version 1.4.1?
.. note:: Ansible can also use a system copy of six
six-1.4.1 is the last version of python-six to support Python-2.4. Until
Ansible-2.4, most Ansible modules were required to run on Python-2.4. So
the bundled version of six could not be newer than 1.4.1.
Ansible-2.4 now targets Python-2.6 or greater for modules. We'll be
updating the bundled six soon.
Ansible will use a system copy of six if the system copy is a later
version than the one Ansible bundles.
-------------------------------------
Porting module_utils code to Python 3