worlddump: log command failure details

If a command we trigger fails for some reason, it's worth logging
details about the failure (like return code).

Change-Id: Ib19aa474eccdd11e138a4f55e125935b621bca05
This commit is contained in:
Ihar Hrachyshka 2016-03-03 15:30:49 +01:00
parent 447af8f3f6
commit 7976aacdf6

View File

@ -58,8 +58,8 @@ def _dump_cmd(cmd):
try:
subprocess.check_call(cmd, shell=True)
print
except subprocess.CalledProcessError:
print "*** Failed to run: %s" % cmd
except subprocess.CalledProcessError as e:
print "*** Failed to run '%(cmd)s': %(err)s" % {'cmd': cmd, 'err': e}
def _find_cmd(cmd):