cli: set non-zero return code for canceled status (#15678)

This commit is contained in:
Marc Hassan 2025-02-25 11:11:47 -05:00 committed by GitHub
parent fb4879b2c9
commit de4a971cb3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,6 +81,8 @@ class Launchable(object):
response.json['status'] = status
if status in ('failed', 'error'):
setattr(response, 'rc', 1)
if status in ('canceled'):
setattr(response, 'rc', 2)
return response
def perform(self, **kwargs):
@ -561,6 +563,8 @@ class HasMonitor(object):
response.json['status'] = status
if status in ('failed', 'error'):
setattr(response, 'rc', 1)
if status in ('canceled'):
setattr(response, 'rc', 2)
else:
return 'Unable to monitor finished job'