Commit 8881dfdd authored by Valentin Reis's avatar Valentin Reis

[bugfix] status-based Traceback on `cmd run` invocations

This converts the return status to int before running the
introspection logic and fixes the issue.
parent 6d8ae62f
Pipeline #6497 failed with stages
in 3 minutes and 14 seconds
......@@ -171,13 +171,14 @@ class CommandLineInterface(object):
logger.error("unexpected message: %r", msg)
if outeof and erreof and state == 'exiting':
state = 'exit'
istatus = int(exitmsg.status)
logger.info("command ended: %r", exitmsg)
if os.WIFSIGNALED(exitmsg.status):
if os.WIFSIGNALED(istatus):
logger.error("command ended due to signal %s" %
str(os.WTERMSIG(exitmsg.status)))
str(os.WTERMSIG(istatus)))
sys.exit(1)
elif os.WIFEXITED(exitmsg.status):
s = int(os.WTERMSIG(exitmsg.status))
elif os.WIFEXITED(istatus):
s = int(os.WTERMSIG(istatus))
if s > 0:
logger.debug("command ended with exit code %s" %
str(s))
......
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