Log stdout and stderr on non-zero exit status

This helps troubleshooting failures when running cfn-init.

Change-Id: I601506ab05d372307bb160b198a675f048e2e9ff
Closes-Bug: #1269470
This commit is contained in:
Simon Pasquier 2014-02-12 15:16:49 +01:00
parent 2202cfdd01
commit 518c02dd0a
1 changed files with 4 additions and 2 deletions

View File

@ -188,8 +188,10 @@ class CommandRunner(object):
self._stdout = output[0]
self._stderr = output[1]
if self._status:
LOG.debug("Return code of %d after executing: '%s'" % (
self._status, cmd))
LOG.debug("Return code of %d after executing: '%s'\n"
"stdout: '%s'\n"
"stderr: '%s'" % (self._status, cmd, self._stdout,
self._stderr))
if self._next:
self._next.run()
return self