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 <>
Reviewed-by: default avatarIustin Pop <>
parent 86b16e9d
......@@ -176,13 +176,17 @@ def CancelJobs(opts, args):
client = GetClient()
result = constants.EXIT_SUCCESS
for job_id in args:
(_, msg) = client.CancelJob(job_id)
(success, msg) = client.CancelJob(job_id)
if not success:
result = constants.EXIT_FAILURE
# TODO: Different exit value if not all jobs were canceled?
return 0
return result
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