k8s_exec: Update deprecation warning (#419)

k8s_exec: Update deprecation warning

SUMMARY
return_code is deprecated in favor of rc, update the
deprecation warning to tell user about the reason behind
this.
Fixes: #417
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
changelogs/fragments/417_deprecation.yml
plugins/modules/k8s_exec.py

Reviewed-by: Mike Graves <mgraves@redhat.com>
This commit is contained in:
Abhijeet Kasurde
2022-03-23 19:44:37 +05:30
committed by GitHub
parent f418353e44
commit 0299aa8807
2 changed files with 5 additions and 1 deletions

View File

@@ -212,7 +212,8 @@ def execute_module(module, k8s_ansible_mixin):
rc = int(err["details"]["causes"][0]["message"])
module.deprecate(
"The 'return_code' return key is deprecated. Please use 'rc' instead.",
"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",
)