1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

On change in diff-mode we don't need to see file content in task output

I was surprised to see complete file content in the (JSON) task output when
in diff-mode. Since we see the diff anyhow, there's no need to send everything
on screen.
This commit is contained in:
Dag Wieers 2016-04-01 18:03:51 +02:00
parent 837f3dd24d
commit d46af7cda3

View file

@ -99,6 +99,10 @@ class CallbackBase:
if not keep_invocation and self._display.verbosity < 3 and 'invocation' in result: if not keep_invocation and self._display.verbosity < 3 and 'invocation' in result:
del abridged_result['invocation'] del abridged_result['invocation']
# remove diff information from screen output
if self._display.verbosity < 3 and 'diff' in result:
del abridged_result['diff']
return json.dumps(abridged_result, indent=indent, ensure_ascii=False, sort_keys=sort_keys) return json.dumps(abridged_result, indent=indent, ensure_ascii=False, sort_keys=sort_keys)
def _handle_warnings(self, res): def _handle_warnings(self, res):