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

otherwise ansible eats out important error messages

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
This commit is contained in:
Tomas Tomecek 2017-06-28 21:55:39 +02:00 committed by Chris Houseknecht
parent 9fdd07fba8
commit 2683c36a01

View file

@ -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