Skip to content

Commit

Permalink
jk status exits with code 2 on unknown jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
flupke committed Dec 4, 2017
1 parent e5252d9 commit a8acc2b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jenskipper/cli/status.py
Expand Up @@ -44,11 +44,13 @@ def _print_job_status(base_dir, jenkins_url, job_name, status_only,
except requests.HTTPError as exc:
if exc.response.status_code == 404:
utils.sechowrap('Unkown job: %s' % job_name)
exit_code = 2
else:
utils.sechowrap('Unexpected HTTP error %s while trying to '
'retrieve job data' % exc.response.status_code,
fg='red')
sys.exit(1)
exit_code = 1
sys.exit(exit_code)

status = _job_status(job_data)
if status_only:
Expand Down

0 comments on commit a8acc2b

Please sign in to comment.