Skip to content

Commit

Permalink
k8s_exec: Update deprecation warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Akasurde committed Mar 22, 2022
1 parent d68dec3 commit 889951f
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 deprecated. Please use 'rc' instead. "
"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 889951f

Please sign in to comment.