Skip to content

Commit

Permalink
cli: set non-zero return code for canceled status
Browse files Browse the repository at this point in the history
  • Loading branch information
mhassan1 committed Feb 4, 2025
1 parent 15932e3 commit 4230a67
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions awxkit/awxkit/cli/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ def monitor(self, response, **kwargs):
response.json['status'] = status
if status in ('failed', 'error'):
setattr(response, 'rc', 1)
if status in ('canceled'):
setattr(response, 'rc', 2)

Check warning on line 85 in awxkit/awxkit/cli/custom.py

View check run for this annotation

Codecov / codecov/patch

awxkit/awxkit/cli/custom.py#L84-L85

Added lines #L84 - L85 were not covered by tests
return response

def perform(self, **kwargs):
Expand Down Expand Up @@ -561,6 +563,8 @@ def perform(self, **kwargs):
response.json['status'] = status
if status in ('failed', 'error'):
setattr(response, 'rc', 1)
if status in ('canceled'):
setattr(response, 'rc', 2)

Check warning on line 567 in awxkit/awxkit/cli/custom.py

View check run for this annotation

Codecov / codecov/patch

awxkit/awxkit/cli/custom.py#L566-L567

Added lines #L566 - L567 were not covered by tests
else:
return 'Unable to monitor finished job'

Expand Down

0 comments on commit 4230a67

Please sign in to comment.