Merge pull request #6081 from ryanpetrello/launch-monitor-rc

cli: make launch with --monitor return code respect the final job status

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot]
2020-02-26 19:18:10 +00:00
committed by GitHub
2 changed files with 4 additions and 0 deletions

View File

@@ -200,6 +200,8 @@ class CLI(object):
)
if formatted:
print(utils.to_str(formatted), file=self.stdout)
if hasattr(response, 'rc'):
raise SystemExit(response.rc)
else:
if six.PY3:
self.parser.print_help()

View File

@@ -90,6 +90,8 @@ class Launchable(object):
)
if status:
response.json['status'] = status
if status in ('failed', 'error'):
setattr(response, 'rc', 1)
return response
def perform(self, **kwargs):