diff options
Diffstat (limited to 'lib')
39 files changed, 73 insertions, 44 deletions
diff --git a/lib/ansible/cli/config.py b/lib/ansible/cli/config.py index 1cb70a94d0..75f345e0ca 100755 --- a/lib/ansible/cli/config.py +++ b/lib/ansible/cli/config.py @@ -12,6 +12,9 @@ from ansible.cli import CLI import os import shlex import subprocess + +from collections.abc import Mapping + import yaml from ansible import context @@ -22,7 +25,6 @@ from ansible.cli.arguments import option_helpers as opt_help from ansible.config.manager import ConfigManager, Setting from ansible.errors import AnsibleError, AnsibleOptionsError from ansible.module_utils._text import to_native, to_text, to_bytes -from ansible.module_utils.common._collections_compat import Mapping from ansible.module_utils.six import string_types from ansible.parsing.quoting import is_quoted from ansible.parsing.yaml.dumper import AnsibleDumper diff --git a/lib/ansible/cli/doc.py b/lib/ansible/cli/doc.py index d1c49765d8..314e517a47 100755 --- a/lib/ansible/cli/doc.py +++ b/lib/ansible/cli/doc.py @@ -17,6 +17,9 @@ import os.path import re import textwrap import traceback + +from collections.abc import Sequence + import yaml import ansible.plugins.loader as plugin_loader @@ -27,7 +30,6 @@ from ansible.cli.arguments import option_helpers as opt_help from ansible.collections.list import list_collection_dirs from ansible.errors import AnsibleError, AnsibleOptionsError, AnsibleParserError from ansible.module_utils._text import to_native, to_text -from ansible.module_utils.common._collections_compat import Sequence from ansible.module_utils.common.json import AnsibleJSONEncoder from ansible.module_utils.common.yaml import yaml_dump from ansible.module_utils.compat import importlib diff --git a/lib/ansible/config/manager.py b/lib/ansible/config/manager.py index 4ec7dd6e31..a28a84a528 100644 --- a/lib/ansible/config/manager.py +++ b/lib/ansible/config/manager.py @@ -12,12 +12,14 @@ import sys import stat import tempfile import traceback + +from collections.abc import Mapping, Sequence + from collections import namedtuple from ansible.config.data import ConfigData from ansible.errors import AnsibleOptionsError, AnsibleError from ansible.module_utils._text import to_text, to_bytes, to_native -from ansible.module_utils.common._collections_compat import Mapping, Sequence from ansible.module_utils.common.yaml import yaml_load from ansible.module_utils.six import string_types from ansible.module_utils.parsing.convert_bool import boolean diff --git a/lib/ansible/context.py b/lib/ansible/context.py index 96f13feac7..216c135e5d 100644 --- a/lib/ansible/context.py +++ b/lib/ansible/context.py @@ -15,7 +15,8 @@ running the ansible command line tools. These APIs are still in flux so do not use them unless you are willing to update them with every Ansible release """ -from ansible.module_utils.common._collections_compat import Mapping, Set +from collections.abc import Mapping, Set + from ansible.module_utils.common.collections import is_sequence from ansible.utils.context_objects import CLIArgs, GlobalCLIArgs diff --git a/lib/ansible/errors/__init__.py b/lib/ansible/errors/__init__.py index f1179ab102..cfc8f1ba2a 100644 --- a/lib/ansible/errors/__init__.py +++ b/lib/ansible/errors/__init__.py @@ -22,6 +22,8 @@ __metaclass__ = type import re import traceback +from collections.abc import Sequence + from ansible.errors.yaml_strings import ( YAML_COMMON_DICT_ERROR, YAML_COMMON_LEADING_TAB_ERROR, @@ -33,7 +35,6 @@ from ansible.errors.yaml_strings import ( YAML_AND_SHORTHAND_ERROR, ) from ansible.module_utils._text import to_native, to_text -from ansible.module_utils.common._collections_compat import Sequence class AnsibleError(Exception): diff --git a/lib/ansible/executor/stats.py b/lib/ansible/executor/stats.py index 30ecc5e7fb..13a053ba3a 100644 --- a/lib/ansible/executor/stats.py +++ b/lib/ansible/executor/stats.py @@ -19,7 +19,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible.module_utils.common._collections_compat import MutableMapping +from collections.abc import MutableMapping + from ansible.utils.vars import merge_hash diff --git a/lib/ansible/galaxy/dependency_resolution/dataclasses.py b/lib/ansible/galaxy/dependency_resolution/dataclasses.py index bfe30a8a02..3caa1a5ea9 100644 --- a/lib/ansible/galaxy/dependency_resolution/dataclasses.py +++ b/lib/ansible/galaxy/dependency_resolution/dataclasses.py @@ -11,7 +11,7 @@ import os import typing as t from collections import namedtuple -from collections.abc import MutableSequence +from collections.abc import MutableSequence, MutableMapping from glob import iglob from urllib.parse import urlparse from yaml import safe_load @@ -30,7 +30,6 @@ if t.TYPE_CHECKING: from ansible.errors import AnsibleError from ansible.galaxy.api import GalaxyAPI from ansible.module_utils._text import to_bytes, to_native, to_text -from ansible.module_utils.common._collections_compat import MutableMapping from ansible.module_utils.common.arg_spec import ArgumentSpecValidator from ansible.utils.collection_loader import AnsibleCollectionRef from ansible.utils.display import Display diff --git a/lib/ansible/inventory/group.py b/lib/ansible/inventory/group.py index ed02fb4cca..51f8fd5712 100644 --- a/lib/ansible/inventory/group.py +++ b/lib/ansible/inventory/group.py @@ -17,12 +17,12 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type +from collections.abc import Mapping, MutableMapping from itertools import chain from ansible import constants as C from ansible.errors import AnsibleError from ansible.module_utils._text import to_native, to_text -from ansible.module_utils.common._collections_compat import Mapping, MutableMapping from ansible.utils.display import Display from ansible.utils.vars import combine_vars diff --git a/lib/ansible/inventory/host.py b/lib/ansible/inventory/host.py index 30d0626f85..3ef5115b5a 100644 --- a/lib/ansible/inventory/host.py +++ b/lib/ansible/inventory/host.py @@ -19,8 +19,9 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type +from collections.abc import Mapping, MutableMapping + from ansible.inventory.group import Group -from ansible.module_utils.common._collections_compat import Mapping, MutableMapping from ansible.parsing.utils.addresses import patterns from ansible.utils.vars import combine_vars, get_unique_id diff --git a/lib/ansible/parsing/yaml/objects.py b/lib/ansible/parsing/yaml/objects.py index 3d183f5895..a2e2a66baa 100644 --- a/lib/ansible/parsing/yaml/objects.py +++ b/lib/ansible/parsing/yaml/objects.py @@ -22,10 +22,11 @@ __metaclass__ = type import string import sys as _sys +from collections.abc import Sequence + import sys import yaml -from ansible.module_utils.common._collections_compat import Sequence from ansible.module_utils.six import text_type from ansible.module_utils._text import to_bytes, to_text, to_native diff --git a/lib/ansible/playbook/role/__init__.py b/lib/ansible/playbook/role/__init__.py index 7bb6972826..7e3511fc40 100644 --- a/lib/ansible/playbook/role/__init__.py +++ b/lib/ansible/playbook/role/__init__.py @@ -21,11 +21,12 @@ __metaclass__ = type import os +from collections.abc import Container, Mapping, Set, Sequence + from ansible import constants as C from ansible.errors import AnsibleError, AnsibleParserError, AnsibleAssertionError from ansible.module_utils._text import to_text from ansible.module_utils.six import binary_type, text_type -from ansible.module_utils.common._collections_compat import Container, Mapping, Set, Sequence from ansible.playbook.attribute import FieldAttribute from ansible.playbook.base import Base from ansible.playbook.collectionsearch import CollectionSearch diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index 2cf7bcf29d..5742536eb1 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -15,13 +15,14 @@ import re import shlex import stat import tempfile + from abc import ABC, abstractmethod +from collections.abc import Sequence from ansible import constants as C from ansible.errors import AnsibleError, AnsibleConnectionFailure, AnsibleActionSkip, AnsibleActionFail, AnsibleAuthenticationFailure from ansible.executor.module_common import modify_module from ansible.executor.interpreter_discovery import discover_interpreter, InterpreterDiscoveryRequiredError -from ansible.module_utils.common._collections_compat import Sequence from ansible.module_utils.json_utils import _filter_non_json_lines from ansible.module_utils.six import binary_type, string_types, text_type from ansible.module_utils._text import to_bytes, to_native, to_text diff --git a/lib/ansible/plugins/action/add_host.py b/lib/ansible/plugins/action/add_host.py index e418563e0b..e569739920 100644 --- a/lib/ansible/plugins/action/add_host.py +++ b/lib/ansible/plugins/action/add_host.py @@ -20,8 +20,9 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type +from collections.abc import Mapping + from ansible.errors import AnsibleActionFail -from ansible.module_utils.common._collections_compat import Mapping from ansible.module_utils.six import string_types from ansible.plugins.action import ActionBase from ansible.parsing.utils.addresses import parse_address diff --git a/lib/ansible/plugins/cache/__init__.py b/lib/ansible/plugins/cache/__init__.py index 49f137cf4c..50acefa225 100644 --- a/lib/ansible/plugins/cache/__init__.py +++ b/lib/ansible/plugins/cache/__init__.py @@ -22,12 +22,13 @@ import copy import os import time import errno + from abc import abstractmethod +from collections.abc import MutableMapping from ansible import constants as C from ansible.errors import AnsibleError from ansible.module_utils._text import to_bytes, to_text -from ansible.module_utils.common._collections_compat import MutableMapping from ansible.plugins import AnsiblePlugin from ansible.plugins.loader import cache_loader from ansible.utils.collection_loader import resource_from_fqcr diff --git a/lib/ansible/plugins/callback/__init__.py b/lib/ansible/plugins/callback/__init__.py index 5b0003d8f0..c3ca6b5dcf 100644 --- a/lib/ansible/plugins/callback/__init__.py +++ b/lib/ansible/plugins/callback/__init__.py @@ -24,11 +24,12 @@ import json import re import sys import textwrap + from collections import OrderedDict +from collections.abc import MutableMapping from copy import deepcopy from ansible import constants as C -from ansible.module_utils.common._collections_compat import MutableMapping from ansible.module_utils.common.text.converters import to_text from ansible.module_utils.six import text_type from ansible.parsing.ajson import AnsibleJSONEncoder diff --git a/lib/ansible/plugins/filter/core.py b/lib/ansible/plugins/filter/core.py index aa6c71eb0a..a1c834403a 100644 --- a/lib/ansible/plugins/filter/core.py +++ b/lib/ansible/plugins/filter/core.py @@ -17,8 +17,9 @@ import sys import time import uuid import yaml - import datetime + +from collections.abc import Mapping from functools import partial from random import Random, SystemRandom, shuffle @@ -28,7 +29,6 @@ from ansible.errors import AnsibleError, AnsibleFilterError, AnsibleFilterTypeEr from ansible.module_utils.six import string_types, integer_types, reraise, text_type from ansible.module_utils._text import to_bytes, to_native, to_text from ansible.module_utils.common.collections import is_sequence -from ansible.module_utils.common._collections_compat import Mapping from ansible.module_utils.common.yaml import yaml_load, yaml_load_all from ansible.parsing.ajson import AnsibleJSONEncoder from ansible.parsing.yaml.dumper import AnsibleDumper diff --git a/lib/ansible/plugins/filter/mathstuff.py b/lib/ansible/plugins/filter/mathstuff.py index 8c4f5270e2..d4b6af7118 100644 --- a/lib/ansible/plugins/filter/mathstuff.py +++ b/lib/ansible/plugins/filter/mathstuff.py @@ -22,16 +22,16 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type - import itertools import math +from collections.abc import Hashable, Mapping, Iterable + from jinja2.filters import pass_environment from ansible.errors import AnsibleFilterError, AnsibleFilterTypeError from ansible.module_utils.common.text import formatters from ansible.module_utils.six import binary_type, text_type -from ansible.module_utils.common._collections_compat import Hashable, Mapping, Iterable from ansible.module_utils._text import to_native, to_text from ansible.utils.display import Display diff --git a/lib/ansible/plugins/inventory/__init__.py b/lib/ansible/plugins/inventory/__init__.py index 299245298d..c0b426456e 100644 --- a/lib/ansible/plugins/inventory/__init__.py +++ b/lib/ansible/plugins/inventory/__init__.py @@ -23,13 +23,14 @@ import hashlib import os import string +from collections.abc import Mapping + from ansible.errors import AnsibleError, AnsibleParserError from ansible.inventory.group import to_safe_group_name as original_safe from ansible.parsing.utils.addresses import parse_address from ansible.plugins import AnsiblePlugin from ansible.plugins.cache import CachePluginAdjudicator as CacheObject from ansible.module_utils._text import to_bytes, to_native -from ansible.module_utils.common._collections_compat import Mapping from ansible.module_utils.parsing.convert_bool import boolean from ansible.module_utils.six import string_types from ansible.template import Templar diff --git a/lib/ansible/plugins/inventory/script.py b/lib/ansible/plugins/inventory/script.py index 9b7e8f04b5..4ffd8e1a45 100644 --- a/lib/ansible/plugins/inventory/script.py +++ b/lib/ansible/plugins/inventory/script.py @@ -33,10 +33,11 @@ DOCUMENTATION = ''' import os import subprocess +from collections.abc import Mapping + from ansible.errors import AnsibleError, AnsibleParserError from ansible.module_utils.basic import json_dict_bytes_to_unicode from ansible.module_utils._text import to_native, to_text -from ansible.module_utils.common._collections_compat import Mapping from ansible.plugins.inventory import BaseInventoryPlugin from ansible.utils.display import Display diff --git a/lib/ansible/plugins/inventory/toml.py b/lib/ansible/plugins/inventory/toml.py index b98987ed27..16403d2650 100644 --- a/lib/ansible/plugins/inventory/toml.py +++ b/lib/ansible/plugins/inventory/toml.py @@ -89,11 +89,11 @@ host4 = {} import os import typing as t +from collections.abc import MutableMapping, MutableSequence from functools import partial from ansible.errors import AnsibleFileNotFound, AnsibleParserError from ansible.module_utils._text import to_bytes, to_native, to_text -from ansible.module_utils.common._collections_compat import MutableMapping, MutableSequence from ansible.module_utils.six import string_types, text_type from ansible.parsing.yaml.objects import AnsibleSequence, AnsibleUnicode from ansible.plugins.inventory import BaseFileInventoryPlugin diff --git a/lib/ansible/plugins/inventory/yaml.py b/lib/ansible/plugins/inventory/yaml.py index 193bdfa774..aac89d31e0 100644 --- a/lib/ansible/plugins/inventory/yaml.py +++ b/lib/ansible/plugins/inventory/yaml.py @@ -67,10 +67,11 @@ all: # keys must be unique, i.e. only one 'hosts' per group import os +from collections.abc import MutableMapping + from ansible.errors import AnsibleError, AnsibleParserError from ansible.module_utils.six import string_types from ansible.module_utils._text import to_native, to_text -from ansible.module_utils.common._collections_compat import MutableMapping from ansible.plugins.inventory import BaseFileInventoryPlugin NoneType = type(None) diff --git a/lib/ansible/plugins/lookup/csvfile.py b/lib/ansible/plugins/lookup/csvfile.py index a44e6920ce..7f66187db0 100644 --- a/lib/ansible/plugins/lookup/csvfile.py +++ b/lib/ansible/plugins/lookup/csvfile.py @@ -69,12 +69,13 @@ RETURN = """ import codecs import csv +from collections.abc import MutableSequence + from ansible.errors import AnsibleError, AnsibleAssertionError from ansible.parsing.splitter import parse_kv from ansible.plugins.lookup import LookupBase from ansible.module_utils.six import PY2 from ansible.module_utils._text import to_bytes, to_native, to_text -from ansible.module_utils.common._collections_compat import MutableSequence class CSVRecoder: diff --git a/lib/ansible/plugins/lookup/dict.py b/lib/ansible/plugins/lookup/dict.py index 9d948deef9..af9a081914 100644 --- a/lib/ansible/plugins/lookup/dict.py +++ b/lib/ansible/plugins/lookup/dict.py @@ -53,9 +53,10 @@ RETURN = """ type: list """ +from collections.abc import Mapping + from ansible.errors import AnsibleError from ansible.plugins.lookup import LookupBase -from ansible.module_utils.common._collections_compat import Mapping class LookupModule(LookupBase): diff --git a/lib/ansible/plugins/lookup/first_found.py b/lib/ansible/plugins/lookup/first_found.py index 6ed2914be5..f09ff98f56 100644 --- a/lib/ansible/plugins/lookup/first_found.py +++ b/lib/ansible/plugins/lookup/first_found.py @@ -136,10 +136,11 @@ RETURN = """ import os import re +from collections.abc import Mapping, Sequence + from jinja2.exceptions import UndefinedError from ansible.errors import AnsibleLookupError, AnsibleUndefinedVariable -from ansible.module_utils.common._collections_compat import Mapping, Sequence from ansible.module_utils.six import string_types from ansible.plugins.lookup import LookupBase diff --git a/lib/ansible/plugins/lookup/ini.py b/lib/ansible/plugins/lookup/ini.py index dd3d178b40..eea8634cd0 100644 --- a/lib/ansible/plugins/lookup/ini.py +++ b/lib/ansible/plugins/lookup/ini.py @@ -82,10 +82,10 @@ import re from io import StringIO from collections import defaultdict +from collections.abc import MutableSequence from ansible.errors import AnsibleLookupError, AnsibleOptionsError from ansible.module_utils._text import to_text, to_native -from ansible.module_utils.common._collections_compat import MutableSequence from ansible.plugins.lookup import LookupBase diff --git a/lib/ansible/plugins/lookup/list.py b/lib/ansible/plugins/lookup/list.py index 69eb13d5d2..6c553aeb5c 100644 --- a/lib/ansible/plugins/lookup/list.py +++ b/lib/ansible/plugins/lookup/list.py @@ -31,7 +31,8 @@ RETURN = """ elements: raw """ -from ansible.module_utils.common._collections_compat import Sequence +from collections.abc import Sequence + from ansible.plugins.lookup import LookupBase from ansible.errors import AnsibleError diff --git a/lib/ansible/plugins/test/core.py b/lib/ansible/plugins/test/core.py index 8609afabbb..01faff9848 100644 --- a/lib/ansible/plugins/test/core.py +++ b/lib/ansible/plugins/test/core.py @@ -21,11 +21,13 @@ __metaclass__ = type import re import operator as py_operator + +from collections.abc import MutableMapping, MutableSequence + from ansible.module_utils.compat.version import LooseVersion, StrictVersion from ansible import errors from ansible.module_utils._text import to_native, to_text -from ansible.module_utils.common._collections_compat import MutableMapping, MutableSequence from ansible.module_utils.parsing.convert_bool import boolean from ansible.utils.display import Display from ansible.utils.version import SemanticVersion diff --git a/lib/ansible/template/__init__.py b/lib/ansible/template/__init__.py index 3df7c5025e..dbc15063e4 100644 --- a/lib/ansible/template/__init__.py +++ b/lib/ansible/template/__init__.py @@ -27,12 +27,12 @@ import pwd import re import time +from collections.abc import Iterator, Sequence, Mapping, MappingView, MutableMapping from contextlib import contextmanager from hashlib import sha1 from numbers import Number from traceback import format_exc - from jinja2.exceptions import TemplateSyntaxError, UndefinedError from jinja2.loaders import FileSystemLoader from jinja2.nativetypes import NativeEnvironment @@ -50,7 +50,6 @@ from ansible.errors import ( ) from ansible.module_utils.six import string_types, text_type from ansible.module_utils._text import to_native, to_text, to_bytes -from ansible.module_utils.common._collections_compat import Iterator, Sequence, Mapping, MappingView, MutableMapping from ansible.module_utils.common.collections import is_sequence from ansible.module_utils.compat.importlib import import_module from ansible.plugins.loader import filter_loader, lookup_loader, test_loader diff --git a/lib/ansible/template/vars.py b/lib/ansible/template/vars.py index 9b3ed19ffe..b91638f25d 100644 --- a/lib/ansible/template/vars.py +++ b/lib/ansible/template/vars.py @@ -19,11 +19,12 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type +from collections.abc import Mapping + from jinja2.utils import missing from ansible.errors import AnsibleError, AnsibleUndefinedVariable from ansible.module_utils._text import to_native -from ansible.module_utils.common._collections_compat import Mapping __all__ = ['AnsibleJ2Vars'] diff --git a/lib/ansible/utils/context_objects.py b/lib/ansible/utils/context_objects.py index 7124174958..efe15fea82 100644 --- a/lib/ansible/utils/context_objects.py +++ b/lib/ansible/utils/context_objects.py @@ -10,8 +10,8 @@ Hold command line arguments for use in other modules """ from abc import ABCMeta +from collections.abc import Container, Mapping, Sequence, Set -from ansible.module_utils.common._collections_compat import (Container, Mapping, Sequence, Set) from ansible.module_utils.common.collections import ImmutableDict from ansible.module_utils.six import add_metaclass, binary_type, text_type from ansible.utils.singleton import Singleton diff --git a/lib/ansible/utils/listify.py b/lib/ansible/utils/listify.py index 89a6583cb2..4f2ae9d446 100644 --- a/lib/ansible/utils/listify.py +++ b/lib/ansible/utils/listify.py @@ -19,8 +19,9 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type +from collections.abc import Iterable + from ansible.module_utils.six import string_types -from ansible.module_utils.common._collections_compat import Iterable __all__ = ['listify_lookup_plugin_terms'] diff --git a/lib/ansible/utils/plugin_docs.py b/lib/ansible/utils/plugin_docs.py index 31134aff3b..3499800c44 100644 --- a/lib/ansible/utils/plugin_docs.py +++ b/lib/ansible/utils/plugin_docs.py @@ -4,12 +4,13 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type +from collections.abc import MutableMapping, MutableSet, MutableSequence + from ansible import constants as C from ansible.release import __version__ as ansible_version from ansible.errors import AnsibleError from ansible.module_utils.six import string_types from ansible.module_utils._text import to_native -from ansible.module_utils.common._collections_compat import MutableMapping, MutableSet, MutableSequence from ansible.parsing.plugin_docs import read_docstring from ansible.parsing.yaml.loader import AnsibleLoader from ansible.utils.display import Display diff --git a/lib/ansible/utils/py3compat.py b/lib/ansible/utils/py3compat.py index 6b46b5e899..88d9fdff50 100644 --- a/lib/ansible/utils/py3compat.py +++ b/lib/ansible/utils/py3compat.py @@ -14,9 +14,10 @@ __metaclass__ = type import os import sys +from collections.abc import MutableMapping + from ansible.module_utils.six import PY3 from ansible.module_utils._text import to_bytes, to_text -from ansible.module_utils.common._collections_compat import MutableMapping __all__ = ('environ',) diff --git a/lib/ansible/utils/unsafe_proxy.py b/lib/ansible/utils/unsafe_proxy.py index 7ed3cffcf1..e10fa8a05e 100644 --- a/lib/ansible/utils/unsafe_proxy.py +++ b/lib/ansible/utils/unsafe_proxy.py @@ -53,8 +53,9 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type +from collections.abc import Mapping, Set + from ansible.module_utils._text import to_bytes, to_text -from ansible.module_utils.common._collections_compat import Mapping, Set from ansible.module_utils.common.collections import is_sequence from ansible.module_utils.six import string_types, binary_type, text_type from ansible.utils.native_jinja import NativeJinjaText diff --git a/lib/ansible/utils/vars.py b/lib/ansible/utils/vars.py index 540dd3e9ec..74bf1425b6 100644 --- a/lib/ansible/utils/vars.py +++ b/lib/ansible/utils/vars.py @@ -23,15 +23,14 @@ import keyword import random import uuid +from collections.abc import MutableMapping, MutableSequence from json import dumps - from ansible import constants as C from ansible import context from ansible.errors import AnsibleError, AnsibleOptionsError from ansible.module_utils.six import string_types, PY3 from ansible.module_utils._text import to_native, to_text -from ansible.module_utils.common._collections_compat import MutableMapping, MutableSequence from ansible.parsing.splitter import parse_kv diff --git a/lib/ansible/vars/clean.py b/lib/ansible/vars/clean.py index c7bac6b2db..1de6fcfa01 100644 --- a/lib/ansible/vars/clean.py +++ b/lib/ansible/vars/clean.py @@ -8,11 +8,12 @@ __metaclass__ = type import os import re +from collections.abc import MutableMapping, MutableSequence + from ansible import constants as C from ansible.errors import AnsibleError from ansible.module_utils import six from ansible.module_utils._text import to_text -from ansible.module_utils.common._collections_compat import MutableMapping, MutableSequence from ansible.plugins.loader import connection_loader from ansible.utils.display import Display diff --git a/lib/ansible/vars/fact_cache.py b/lib/ansible/vars/fact_cache.py index 16319cc21c..868a90549a 100644 --- a/lib/ansible/vars/fact_cache.py +++ b/lib/ansible/vars/fact_cache.py @@ -6,10 +6,10 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type +from collections.abc import MutableMapping from ansible import constants as C from ansible.errors import AnsibleError -from ansible.module_utils.common._collections_compat import MutableMapping from ansible.plugins.loader import cache_loader from ansible.utils.display import Display diff --git a/lib/ansible/vars/hostvars.py b/lib/ansible/vars/hostvars.py index b47ec1975c..e6679efed6 100644 --- a/lib/ansible/vars/hostvars.py +++ b/lib/ansible/vars/hostvars.py @@ -19,7 +19,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible.module_utils.common._collections_compat import Mapping +from collections.abc import Mapping + from ansible.template import Templar, AnsibleUndefined STATIC_VARS = [ diff --git a/lib/ansible/vars/manager.py b/lib/ansible/vars/manager.py index a8fdcd7b37..e3630d74f3 100644 --- a/lib/ansible/vars/manager.py +++ b/lib/ansible/vars/manager.py @@ -23,6 +23,7 @@ import os import sys from collections import defaultdict +from collections.abc import Mapping, MutableMapping, Sequence from hashlib import sha1 from jinja2.exceptions import UndefinedError @@ -32,7 +33,6 @@ from ansible.errors import AnsibleError, AnsibleParserError, AnsibleUndefinedVar from ansible.inventory.host import Host from ansible.inventory.helpers import sort_groups, get_group_vars from ansible.module_utils._text import to_text -from ansible.module_utils.common._collections_compat import Mapping, MutableMapping, Sequence from ansible.module_utils.six import text_type, string_types from ansible.plugins.loader import lookup_loader from ansible.vars.fact_cache import FactCache |