mirror of
https://github.com/zebrajr/ansible.git
synced 2025-12-06 00:19:48 +01:00
Soft deprecate ansible.module_utils.six (#86048)
This commit is contained in:
parent
6dd48814f2
commit
e4b4787c02
3
changelogs/fragments/soft-deprecate-six.yml
Normal file
3
changelogs/fragments/soft-deprecate-six.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
deprecated_features:
|
||||
- >
|
||||
``ansible.module_utils.six`` - The ``six`` compatibility library provided at ``ansible.module_utils.six`` is deprecated, and planned for removal in ansible-core 2.24
|
||||
|
|
@ -33,6 +33,8 @@ import operator
|
|||
import sys
|
||||
import types
|
||||
|
||||
# deprecated: description="Replace with ansible.module_utils.common.warnings.deprecate for 2.24" core_version="2.22"
|
||||
|
||||
# The following makes it easier for us to script updates of the bundled code. It is not part of
|
||||
# upstream six
|
||||
_BUNDLED_METADATA = {"pypi_name": "six", "version": "1.17.0"}
|
||||
|
|
|
|||
|
|
@ -110,6 +110,10 @@ class AnsibleUnwantedChecker(BaseChecker):
|
|||
'Iterator',
|
||||
)
|
||||
),
|
||||
|
||||
'ansible.module_utils.six': UnwantedEntry(
|
||||
'the Python standard library equivalent'
|
||||
),
|
||||
}
|
||||
|
||||
unwanted_functions = {
|
||||
|
|
@ -134,14 +138,6 @@ class AnsibleUnwantedChecker(BaseChecker):
|
|||
modules_only=True),
|
||||
}
|
||||
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
super().__init__(*args, **kwargs)
|
||||
# ansible.module_utils.six is deprecated and collections can still use it until it is removed
|
||||
if self.is_ansible_core:
|
||||
self.unwanted_imports['ansible.module_utils.six'] = UnwantedEntry(
|
||||
'the Python standard library equivalent'
|
||||
)
|
||||
|
||||
@functools.cached_property
|
||||
def is_ansible_core(self) -> bool:
|
||||
"""True if ansible-core is being tested."""
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user