diff --git a/changelogs/fragments/20260109-fix-deprecated-calls.yaml b/changelogs/fragments/20260109-fix-deprecated-calls.yaml new file mode 100644 index 00000000..60e3e65d --- /dev/null +++ b/changelogs/fragments/20260109-fix-deprecated-calls.yaml @@ -0,0 +1,3 @@ +--- +minor_changes: + - use `collections.abc` instead of deprecated `ansible.module_utils.common._collections_compat` (https://github.com/ansible-collections/kubernetes.core/pull/1057). diff --git a/plugins/lookup/k8s.py b/plugins/lookup/k8s.py index ec9fc0c6..c524a935 100644 --- a/plugins/lookup/k8s.py +++ b/plugins/lookup/k8s.py @@ -209,9 +209,9 @@ RETURN = """ """ import os +from collections.abc import KeysView from ansible.errors import AnsibleError -from ansible.module_utils.common._collections_compat import KeysView from ansible.module_utils.common.validation import check_type_bool from ansible_collections.kubernetes.core.plugins.module_utils.k8s.client import ( get_api_client, diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index 107283c9..cdc1a01a 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -4,11 +4,11 @@ __metaclass__ = type import json import sys +from collections.abc import MutableMapping from io import BytesIO import ansible.module_utils.basic import pytest -from ansible.module_utils.common._collections_compat import MutableMapping from ansible.module_utils.common.text.converters import to_bytes