plugins,action: log stderr output if verbose (#25734)

otherwise ansible eats out important error messages

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
pull/26200/head
Tomas Tomecek 7 years ago committed by Chris Houseknecht
parent 9fdd07fba8
commit 2683c36a01

@ -270,7 +270,9 @@ class ActionBase(with_metaclass(ABCMeta, object)):
'Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". '
'Failed command was: %s, exited with result %d' % (cmd, result['rc']))
if 'stdout' in result and result['stdout'] != u'':
output = output + u": %s" % result['stdout']
output = output + u", stdout output: %s" % result['stdout']
if self._play_context.verbosity > 3 and 'stderr' in result and result['stderr'] != u'':
output += u", stderr output: %s" % result['stderr']
raise AnsibleConnectionFailure(output)
else:
self._cleanup_remote_tmp = True

Loading…
Cancel
Save