Commit e3f213e0 by Michael DeHaan

Fixup error reporting.

parent c07dd077
...@@ -731,12 +731,15 @@ class Runner(object): ...@@ -731,12 +731,15 @@ class Runner(object):
# error handling on this seems a little aggressive? # error handling on this seems a little aggressive?
if result['rc'] != 0: if result['rc'] != 0:
raise errors.AnsibleError('could not create temporary directory, SSH (%s) exited with result %d' % (cmd, result['rc'])) output = 'could not create temporary directory, SSH (%s) exited with result %d' % (cmd, result['rc'])
if 'stdout' in result and result['stdout'] != '':
output = output + ": %s" % result['stdout']
raise errors.AnsibleError(output)
rc = utils.last_non_blank_line(result['stdout']).strip() + '/' rc = utils.last_non_blank_line(result['stdout']).strip() + '/'
# Catch failure conditions, files should never be # Catch failure conditions, files should never be
# written to locations in /. # written to locations in /.
if rc.startswith('/'): if rc == '/':
raise errors.AnsibleError('failed to resolve remote temporary directory from %s: `%s` returned empty string' % (basetmp, cmd)) raise errors.AnsibleError('failed to resolve remote temporary directory from %s: `%s` returned empty string' % (basetmp, cmd))
return rc return rc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment