mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +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,19 +24,18 @@ import sys
|
||||
|
||||
from collections import defaultdict, MutableMapping
|
||||
|
||||
from ansible.compat.six import iteritems
|
||||
from jinja2.exceptions import UndefinedError
|
||||
|
||||
try:
|
||||
from hashlib import sha1
|
||||
except ImportError:
|
||||
from sha import sha as sha1
|
||||
|
||||
from jinja2.exceptions import UndefinedError
|
||||
|
||||
from ansible import constants as C
|
||||
from ansible.cli import CLI
|
||||
from ansible.compat.six import string_types, text_type
|
||||
from ansible.errors import AnsibleError, AnsibleParserError, AnsibleUndefinedVariable, AnsibleFileNotFound
|
||||
from ansible.inventory.host import Host
|
||||
from ansible.module_utils.six import iteritems, string_types, text_type
|
||||
from ansible.plugins import lookup_loader
|
||||
from ansible.plugins.cache import FactCache
|
||||
from ansible.template import Templar
|
||||
@@ -51,14 +50,17 @@ except ImportError:
|
||||
from ansible.utils.display import Display
|
||||
display = Display()
|
||||
|
||||
VARIABLE_CACHE = dict()
|
||||
HOSTVARS_CACHE = dict()
|
||||
|
||||
VARIABLE_CACHE = {}
|
||||
HOSTVARS_CACHE = {}
|
||||
|
||||
|
||||
class AnsibleInventoryVarsData(dict):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(AnsibleInventoryVarsData, self).__init__(*args, **kwargs)
|
||||
self.path = None
|
||||
|
||||
|
||||
def preprocess_vars(a):
|
||||
'''
|
||||
Ensures that vars contained in the parameter passed in are
|
||||
|
||||
@@ -54,7 +54,7 @@ from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import json
|
||||
from ansible.compat.six import string_types, text_type
|
||||
from ansible.module_utils.six import string_types, text_type
|
||||
from ansible.module_utils._text import to_text
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user