Skip to content

Commit

Permalink
k8s_exec: Update deprecation warning (ansible-collections#419)
Browse files Browse the repository at this point in the history
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: ansible-collections#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>
  • Loading branch information
Akasurde authored Mar 23, 2022
1 parent f418353 commit 0299aa8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelogs/fragments/417_deprecation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- k8s_exec - update deprecation warning for `return_code` (https://github.com/ansible-collections/kubernetes.core/issues/417).
3 changes: 2 additions & 1 deletion plugins/modules/k8s_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down

0 comments on commit 0299aa8

Please sign in to comment.