Skip to content

Commit 998fdef

Browse files
Merge pull request #33 from RanabirChakraborty/AMW-441
AMW-441 common collection CI jobs are failing due to some python module
2 parents 9e2f3ee + ac01590 commit 998fdef

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

plugins/module_utils/version.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@
99
from __future__ import absolute_import, division, print_function
1010
__metaclass__ = type
1111

12-
13-
from ansible.module_utils.six import raise_from
14-
1512
try:
1613
from ansible.module_utils.compat.version import LooseVersion # noqa: F401, pylint: disable=unused-import
1714
except ImportError:
1815
try:
1916
from distutils.version import LooseVersion # noqa: F401, pylint: disable=unused-import
2017
except ImportError as exc:
2118
msg = 'To use this plugin or module with ansible-core 2.11, you need to use Python < 3.12 with distutils.version present'
22-
raise_from(ImportError(msg), exc)
19+
raise ImportError(msg) from exc

plugins/modules/xml.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@
379379
HAS_LXML = False
380380

381381
from ansible.module_utils.basic import AnsibleModule, json_dict_bytes_to_unicode, missing_required_lib
382-
from ansible.module_utils.six import iteritems, string_types
383382
from ansible.module_utils.common.text.converters import to_bytes
384383
from ansible.module_utils.common._collections_compat import MutableMapping
385384

@@ -760,13 +759,13 @@ def child_to_element(module, child, in_type):
760759
except etree.XMLSyntaxError as e:
761760
module.fail_json(msg="Error while parsing child element: %s" % e)
762761
elif in_type == 'yaml':
763-
if isinstance(child, string_types):
762+
if isinstance(child, str):
764763
return etree.Element(child)
765764
elif isinstance(child, MutableMapping):
766765
if len(child) > 1:
767766
module.fail_json(msg="Can only create children from hashes with one key")
768767

769-
(key, value) = next(iteritems(child))
768+
(key, value) = next(iter(child.items()))
770769
if isinstance(value, MutableMapping):
771770
children = value.pop('_', None)
772771

0 commit comments

Comments
 (0)