From 329d3b892b05191ea2134a2275e027210816843d Mon Sep 17 00:00:00 2001 From: Chen Zhiwei Date: Wed, 7 Nov 2018 01:36:42 +0800 Subject: [PATCH] if we already have stderr, we don't need stderr_lines (#44675) --- lib/ansible/plugins/callback/yaml.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/plugins/callback/yaml.py b/lib/ansible/plugins/callback/yaml.py index 756fb79bf2..9ef8b4e6c3 100644 --- a/lib/ansible/plugins/callback/yaml.py +++ b/lib/ansible/plugins/callback/yaml.py @@ -114,6 +114,10 @@ class CallbackModule(Default): if 'stdout' in abridged_result and 'stdout_lines' in abridged_result: abridged_result['stdout_lines'] = '' + # if we already have stderr, we don't need stderr_lines + if 'stderr' in abridged_result and 'stderr_lines' in abridged_result: + abridged_result['stderr_lines'] = '' + if abridged_result: dumped += '\n' dumped += to_text(yaml.dump(abridged_result, allow_unicode=True, width=1000, Dumper=AnsibleDumper, default_flow_style=False))