From a48a68ecfd531ca960ce81a126e42fc75cc86c22 Mon Sep 17 00:00:00 2001 From: Mike Graves Date: Tue, 14 Sep 2021 10:40:58 -0400 Subject: [PATCH] Add deprecation notice to k8s_exec (#233) Add deprecation notice to k8s_exec SUMMARY ISSUE TYPE Bugfix Pull Request COMPONENT NAME ADDITIONAL INFORMATION Reviewed-by: None Reviewed-by: Mike Graves Reviewed-by: Alina Buzachis Reviewed-by: None --- changelogs/fragments/223-add-deprecation-notice.yaml | 3 +++ plugins/modules/k8s_exec.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/223-add-deprecation-notice.yaml diff --git a/changelogs/fragments/223-add-deprecation-notice.yaml b/changelogs/fragments/223-add-deprecation-notice.yaml new file mode 100644 index 00000000..8c3b7ac6 --- /dev/null +++ b/changelogs/fragments/223-add-deprecation-notice.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: + - k8s_exec - add missing deprecation notice to return_code for k8s_exec (https://github.com/ansible-collections/kubernetes.core/pull/233). diff --git a/plugins/modules/k8s_exec.py b/plugins/modules/k8s_exec.py index bdb8418d..3ce10d0f 100644 --- a/plugins/modules/k8s_exec.py +++ b/plugins/modules/k8s_exec.py @@ -31,7 +31,7 @@ requirements: - "PyYAML >= 3.11" notes: - - Return code C(rc) for the command executed is added in output in version 2.3.0, and depricates return code C(return_code). + - Return code C(rc) for the command executed is added in output in version 2.2.0, and deprecates return code C(return_code). - Return code C(return_code) for the command executed is added in output in version 1.0.0. - The authenticated user must have at least read access to the pods resource and write access to the pods/exec resource. @@ -110,7 +110,7 @@ result: type: int version_added: 2.3.0 return_code: - description: The command status code. This attribute is depricated and will remove in future release. Please use rc instead. + description: The command status code. This attribute is deprecated and will be removed in a future release. Please use rc instead. type: int ''' @@ -183,6 +183,7 @@ def execute_module(module, k8s_ansible_mixin): else: rc = int(err['details']['causes'][0]['message']) + module.deprecate("The 'return_code' return key is deprecated. Please use 'rc' instead.", version="4.0.0", collection_name="kubernetes.core") module.exit_json( # Some command might change environment, but ultimately failing at end changed=True,