Commit 6d8ae62f authored by Valentin Reis's avatar Valentin Reis

Merge branch '44-cmd-run-error-code' into 'master'

Resolve "`cmd run` error code"

Closes #44

See merge request !77
parents 3e354d82 4633862e
Pipeline #6496 failed with stages
in 3 minutes and 24 seconds
......@@ -172,7 +172,21 @@ class CommandLineInterface(object):
if outeof and erreof and state == 'exiting':
state = 'exit'
logger.info("command ended: %r", exitmsg)
sys.exit(int(exitmsg.status))
if os.WIFSIGNALED(exitmsg.status):
logger.error("command ended due to signal %s" %
str(os.WTERMSIG(exitmsg.status)))
sys.exit(1)
elif os.WIFEXITED(exitmsg.status):
s = int(os.WTERMSIG(exitmsg.status))
if s > 0:
logger.debug("command ended with exit code %s" %
str(s))
sys.exit(s)
else:
logger.error(
"non-compliant exit code received from"
"daemon: %s" % str(exitmsg.status))
sys.exit(1)
break
def do_list(self, argv):
......
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