mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
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:
@@ -24,9 +24,10 @@ import shlex
|
||||
import subprocess
|
||||
import select
|
||||
|
||||
from ansible.compat.six import PY2, PY3
|
||||
from ansible.module_utils.six import PY2, PY3
|
||||
from ansible.module_utils._text import to_bytes
|
||||
|
||||
|
||||
def run_cmd(cmd, live=False, readsize=10):
|
||||
|
||||
#readsize = 10
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.six import string_types
|
||||
from ansible.module_utils.six import string_types
|
||||
|
||||
|
||||
def pct_to_int(value, num_items, min_value=1):
|
||||
'''
|
||||
|
||||
@@ -21,13 +21,14 @@ __metaclass__ = type
|
||||
|
||||
from collections import Iterable
|
||||
|
||||
from ansible.compat.six import string_types
|
||||
|
||||
from ansible.module_utils.six import string_types
|
||||
from ansible.template import Templar
|
||||
from ansible.template.safe_eval import safe_eval
|
||||
|
||||
|
||||
__all__ = ['listify_lookup_plugin_terms']
|
||||
|
||||
|
||||
def listify_lookup_plugin_terms(terms, templar, loader, fail_on_undefined=True, convert_bare=False):
|
||||
|
||||
if isinstance(terms, string_types):
|
||||
|
||||
@@ -25,7 +25,7 @@ import yaml
|
||||
|
||||
from collections import MutableMapping, MutableSet, MutableSequence
|
||||
|
||||
from ansible.compat.six import string_types
|
||||
from ansible.module_utils.six import string_types
|
||||
from ansible.parsing.yaml.loader import AnsibleLoader
|
||||
from ansible.plugins import fragment_loader
|
||||
|
||||
@@ -35,6 +35,7 @@ except ImportError:
|
||||
from ansible.utils.display import Display
|
||||
display = Display()
|
||||
|
||||
|
||||
# modules that are ok that they do not have documentation strings
|
||||
BLACKLIST = {
|
||||
'MODULE': frozenset(('async_wrapper',)),
|
||||
|
||||
@@ -20,7 +20,7 @@ from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import shlex
|
||||
from ansible.compat.six import PY3
|
||||
from ansible.module_utils.six import PY3
|
||||
from ansible.module_utils._text import to_bytes, to_text
|
||||
|
||||
|
||||
|
||||
@@ -26,18 +26,20 @@ import uuid
|
||||
from json import dumps
|
||||
from collections import MutableMapping
|
||||
|
||||
from ansible.compat.six import iteritems, string_types
|
||||
from ansible.module_utils.six import iteritems, string_types
|
||||
|
||||
from ansible import constants as C
|
||||
from ansible.errors import AnsibleError, AnsibleOptionsError
|
||||
from ansible.parsing.splitter import parse_kv
|
||||
from ansible.module_utils._text import to_native, to_text
|
||||
|
||||
|
||||
_MAXSIZE = 2**32
|
||||
cur_id = 0
|
||||
node_mac = ("%012x" % uuid.getnode())[:12]
|
||||
random_int = ("%08x" % random.randint(0, _MAXSIZE))[:8]
|
||||
|
||||
|
||||
def get_unique_id():
|
||||
global cur_id
|
||||
cur_id += 1
|
||||
|
||||
Reference in New Issue
Block a user