Commit 06fef5e0 authored by Michael Hanselmann's avatar Michael Hanselmann

gnt-job cancel: Use non-zero exit status if canceling failed

This allows the use “gnt-job cancel” in scripts.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 86b16e9d
...@@ -176,13 +176,17 @@ def CancelJobs(opts, args): ...@@ -176,13 +176,17 @@ def CancelJobs(opts, args):
""" """
client = GetClient() client = GetClient()
result = constants.EXIT_SUCCESS
for job_id in args: for job_id in args:
(_, msg) = client.CancelJob(job_id) (success, msg) = client.CancelJob(job_id)
if not success:
result = constants.EXIT_FAILURE
ToStdout(msg) ToStdout(msg)
# TODO: Different exit value if not all jobs were canceled? return result
return 0
def ShowJobs(opts, args): def ShowJobs(opts, args):
......
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