mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 22:49:32 -02:30
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:
@@ -200,6 +200,8 @@ class CLI(object):
|
|||||||
)
|
)
|
||||||
if formatted:
|
if formatted:
|
||||||
print(utils.to_str(formatted), file=self.stdout)
|
print(utils.to_str(formatted), file=self.stdout)
|
||||||
|
if hasattr(response, 'rc'):
|
||||||
|
raise SystemExit(response.rc)
|
||||||
else:
|
else:
|
||||||
if six.PY3:
|
if six.PY3:
|
||||||
self.parser.print_help()
|
self.parser.print_help()
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ class Launchable(object):
|
|||||||
)
|
)
|
||||||
if status:
|
if status:
|
||||||
response.json['status'] = status
|
response.json['status'] = status
|
||||||
|
if status in ('failed', 'error'):
|
||||||
|
setattr(response, 'rc', 1)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def perform(self, **kwargs):
|
def perform(self, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user