From 61f2147385d6116f2bb2f73dbf7cfe8f587871ba Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 18 May 2016 06:18:01 -0700 Subject: [PATCH] Rename pycompat to pycompat24 This change makes it so we know when it is safe to get rid of the module (when we stop supporting python2.4) and makes it easier for us to find code that is using the functions in there to update. If needed, we'll create a pycompat26 and pycompat27 as well. These files are for functions that are needed on that python version to write portable code. So python-2.4 compatible modules may need code in pycompat24, python26+ modules may need code in pycompat26, etc. If a function is needed in multiple python versions, we should implement it in an internal common file and use import to put it in the namespace for each pycompatXY module. --- lib/ansible/module_utils/basic.py | 2 +- lib/ansible/module_utils/{pycompat.py => pycompat24.py} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename lib/ansible/module_utils/{pycompat.py => pycompat24.py} (100%) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 54facf1e79..cd88ca04a9 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -220,7 +220,7 @@ except ImportError: _literal_eval = literal_eval # Backwards compat. There were present in basic.py before -from ansible.module_utils.pycompat import get_exception +from ansible.module_utils.pycompat24 import get_exception # Internal global holding passed in params and constants. This is consulted # in case multiple AnsibleModules are created. Otherwise each AnsibleModule diff --git a/lib/ansible/module_utils/pycompat.py b/lib/ansible/module_utils/pycompat24.py similarity index 100% rename from lib/ansible/module_utils/pycompat.py rename to lib/ansible/module_utils/pycompat24.py