mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 04:41:26 -07:00
fixes for stripping (#52930)
function changed to do in place replacement, should be less expensive even with copy as it avoids 'sub copies', can compose with module_args_copy to create replacement for old behavior attempt to fix #52910 * handle lists and subdicts correctly * added missing exception case, which was not noticed since 'cleaning' was not working * added comments to clarify exceptions
This commit is contained in:
parent
7a387e216e
commit
b793f08a92
11 changed files with 83 additions and 47 deletions
|
@ -28,7 +28,7 @@ import sys
|
|||
from ansible.module_utils._text import to_bytes, to_text
|
||||
from ansible.module_utils.six import string_types
|
||||
from ansible.parsing.yaml.dumper import AnsibleDumper
|
||||
from ansible.plugins.callback import CallbackBase, strip_internal_keys
|
||||
from ansible.plugins.callback import CallbackBase, strip_internal_keys, module_response_deepcopy
|
||||
from ansible.plugins.callback.default import CallbackModule as Default
|
||||
|
||||
|
||||
|
@ -85,7 +85,7 @@ class CallbackModule(Default):
|
|||
return json.dumps(dict(censored="The output has been hidden due to the fact that 'no_log: true' was specified for this result"))
|
||||
|
||||
# All result keys stating with _ansible_ are internal, so remove them from the result before we output anything.
|
||||
abridged_result = strip_internal_keys(result)
|
||||
abridged_result = strip_internal_keys(module_response_deepcopy(result))
|
||||
|
||||
# remove invocation unless specifically wanting it
|
||||
if not keep_invocation and self._display.verbosity < 3 and 'invocation' in result:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue