mirror of
https://github.com/ansible/ansible.git
synced 2025-11-30 23:16:08 +07:00
2
changelogs/fragments/85997-basic-py-deprecations.yml
Normal file
2
changelogs/fragments/85997-basic-py-deprecations.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
removed_features:
|
||||
- Removed deprecated ability to import ``datetime``, ``signal``, ``types``, ``chain``, ``repeat``, ``map`` and ``shlex_quote`` from ``ansible.module_utils.basic``.
|
||||
@@ -2200,30 +2200,11 @@ _mini_six = {
|
||||
|
||||
def __getattr__(importable_name):
|
||||
"""Inject import-time deprecation warnings."""
|
||||
if importable_name == 'datetime':
|
||||
import datetime
|
||||
importable = datetime
|
||||
elif importable_name == 'signal':
|
||||
import signal
|
||||
importable = signal
|
||||
elif importable_name == 'types':
|
||||
import types
|
||||
importable = types
|
||||
elif importable_name == 'chain':
|
||||
from itertools import chain
|
||||
importable = chain
|
||||
elif importable_name == 'repeat':
|
||||
from itertools import repeat
|
||||
importable = repeat
|
||||
elif importable_name == 'map':
|
||||
importable = map
|
||||
elif importable_name == 'shlex_quote':
|
||||
importable = shlex.quote
|
||||
elif (importable := _mini_six.get(importable_name, ...)) is ...:
|
||||
if (importable := _mini_six.get(importable_name, ...)) is ...:
|
||||
raise AttributeError(f"module {__name__!r} has no attribute {importable_name!r}")
|
||||
|
||||
deprecate(
|
||||
msg=f"Importing '{importable_name}' from '{__name__}' is deprecated.",
|
||||
version="2.21",
|
||||
version="2.24",
|
||||
)
|
||||
return importable
|
||||
|
||||
@@ -228,7 +228,6 @@ test/integration/targets/ansible-test-sanity-pylint/deprecated_thing.py pylint:a
|
||||
test/integration/targets/ansible-test-sanity-pylint/deprecated_thing.py pylint:ansible-deprecated-date-not-permitted # required to verify plugin against core
|
||||
test/integration/targets/ansible-test-sanity-pylint/deprecated_thing.py pylint:ansible-deprecated-unnecessary-collection-name # required to verify plugin against core
|
||||
test/integration/targets/ansible-test-sanity-pylint/deprecated_thing.py pylint:ansible-deprecated-collection-name-not-permitted # required to verify plugin against core
|
||||
lib/ansible/module_utils/basic.py pylint:ansible-deprecated-version # TODO: 2.21
|
||||
lib/ansible/module_utils/compat/paramiko.py pylint:ansible-deprecated-version # TODO: 2.21
|
||||
lib/ansible/plugins/connection/paramiko_ssh.py pylint:ansible-deprecated-version # TODO: 2.21
|
||||
lib/ansible/plugins/strategy/__init__.py pylint:ansible-deprecated-version # TODO: 2.21
|
||||
|
||||
Reference in New Issue
Block a user