mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-13 13:02:01 +00:00
Remove deprecated function from module_utils/common.py (#726)
Remove deprecated function from module_utils/common.py SUMMARY Remove deprecated functions and class from module_utils/common.py in order to prepare release 4.0.0 ISSUE TYPE Feature Pull Request COMPONENT NAME module_utils/common.py Reviewed-by: Alina Buzachis
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
removed_features:
|
||||||
|
- k8s_exec - the previously deprecated ``result.return_code`` return value has been removed, consider using ``result.rc`` instead (https://github.com/ansible-collections/kubernetes.core/pull/726).
|
||||||
|
- module_utils/common.py - the previously deprecated ``K8sAnsibleMixin`` class has been removed (https://github.com/ansible-collections/kubernetes.core/pull/726).
|
||||||
|
- module_utils/common.py - the previously deprecated ``configuration_digest()`` function has been removed (https://github.com/ansible-collections/kubernetes.core/pull/726).
|
||||||
|
- module_utils/common.py - the previously deprecated ``get_api_client()`` function has been removed (https://github.com/ansible-collections/kubernetes.core/pull/726).
|
||||||
|
- module_utils/common.py - the previously deprecated ``unique_string()`` function has been removed (https://github.com/ansible-collections/kubernetes.core/pull/726).
|
||||||
@@ -125,18 +125,18 @@ import json
|
|||||||
|
|
||||||
from ansible.errors import AnsibleError
|
from ansible.errors import AnsibleError
|
||||||
from ansible.plugins.inventory import BaseInventoryPlugin, Cacheable, Constructable
|
from ansible.plugins.inventory import BaseInventoryPlugin, Cacheable, Constructable
|
||||||
from ansible_collections.kubernetes.core.plugins.module_utils.common import (
|
|
||||||
HAS_K8S_MODULE_HELPER,
|
|
||||||
k8s_import_exception,
|
|
||||||
)
|
|
||||||
from ansible_collections.kubernetes.core.plugins.module_utils.k8s.client import (
|
|
||||||
get_api_client,
|
|
||||||
)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from kubernetes.dynamic.exceptions import DynamicApiError
|
from kubernetes.dynamic.exceptions import DynamicApiError
|
||||||
except ImportError:
|
|
||||||
pass
|
HAS_K8S_MODULE_HELPER = True
|
||||||
|
k8s_import_exception = None
|
||||||
|
except ImportError as e:
|
||||||
|
HAS_K8S_MODULE_HELPER = False
|
||||||
|
k8s_import_exception = e
|
||||||
|
from ansible_collections.kubernetes.core.plugins.module_utils.k8s.client import (
|
||||||
|
get_api_client,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def format_dynamic_api_exc(exc):
|
def format_dynamic_api_exc(exc):
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -135,7 +135,7 @@ from ansible.module_utils._text import to_native
|
|||||||
from ansible_collections.kubernetes.core.plugins.module_utils.ansiblemodule import (
|
from ansible_collections.kubernetes.core.plugins.module_utils.ansiblemodule import (
|
||||||
AnsibleModule,
|
AnsibleModule,
|
||||||
)
|
)
|
||||||
from ansible_collections.kubernetes.core.plugins.module_utils.common import (
|
from ansible_collections.kubernetes.core.plugins.module_utils.args_common import (
|
||||||
AUTH_ARG_SPEC,
|
AUTH_ARG_SPEC,
|
||||||
)
|
)
|
||||||
from ansible_collections.kubernetes.core.plugins.module_utils.k8s.client import (
|
from ansible_collections.kubernetes.core.plugins.module_utils.k8s.client import (
|
||||||
@@ -219,12 +219,6 @@ def execute_module(module, client):
|
|||||||
else:
|
else:
|
||||||
rc = int(err["details"]["causes"][0]["message"])
|
rc = int(err["details"]["causes"][0]["message"])
|
||||||
|
|
||||||
module.deprecate(
|
|
||||||
"The 'return_code' return key is being renamed to 'rc'. "
|
|
||||||
"Both keys are being returned for now to allow users to migrate their automation.",
|
|
||||||
version="4.0.0",
|
|
||||||
collection_name="kubernetes.core",
|
|
||||||
)
|
|
||||||
module.exit_json(
|
module.exit_json(
|
||||||
# Some command might change environment, but ultimately failing at end
|
# Some command might change environment, but ultimately failing at end
|
||||||
changed=True,
|
changed=True,
|
||||||
|
|||||||
Reference in New Issue
Block a user