Bladeren bron

Merge pull request #6588 from vrutkovs/remove-ansible-compat-six

Don't use from ansible.module_utils.six as its no longer available in Ansible 2.4
Scott Dodson 7 jaren geleden
bovenliggende
commit
2e1a132845

+ 4 - 7
roles/lib_utils/filter_plugins/oo_filters.py

@@ -21,13 +21,10 @@ import yaml
 from ansible import errors
 from ansible.parsing.yaml.dumper import AnsibleDumper
 
-# ansible.compat.six goes away with Ansible 2.4
-try:
-    from ansible.compat.six import string_types, u
-    from ansible.compat.six.moves.urllib.parse import urlparse
-except ImportError:
-    from ansible.module_utils.six import string_types, u
-    from ansible.module_utils.six.moves.urllib.parse import urlparse
+# pylint: disable=import-error,no-name-in-module
+from ansible.module_utils.six import string_types, u
+# pylint: disable=import-error,no-name-in-module
+from ansible.module_utils.six.moves.urllib.parse import urlparse
 
 HAS_OPENSSL = False
 try:

+ 1 - 5
roles/lib_utils/filter_plugins/openshift_master.py

@@ -10,11 +10,7 @@ from ansible import errors
 from ansible.parsing.yaml.dumper import AnsibleDumper
 from ansible.plugins.filter.core import to_bool as ansible_bool
 
-# ansible.compat.six goes away with Ansible 2.4
-try:
-    from ansible.compat.six import string_types, u
-except ImportError:
-    from ansible.module_utils.six import string_types, u
+from ansible.module_utils.six import string_types, u
 
 import yaml
 

+ 1 - 5
utils/src/ooinstall/ansible_plugins/facts_callback.py

@@ -7,11 +7,7 @@ import yaml
 from ansible.plugins.callback import CallbackBase
 from ansible.parsing.yaml.dumper import AnsibleDumper
 
-# ansible.compat.six goes away with Ansible 2.4
-try:
-    from ansible.compat.six import u
-except ImportError:
-    from ansible.module_utils.six import u
+from ansible.module_utils.six import u
 
 
 # pylint: disable=super-init-not-called