Commit 5ca0e29a authored by Neil Williams's avatar Neil Williams
Browse files

Fix error in efa0f5

Keep the pipeline job output consistent with the documented
interface dictionary.
Check for a results_link first for V1 jobs, quicker than raising
and then catching the TypeError exception.

Change-Id: I7a311a5a24230c473f38a908aac9516264278792
parent 8441ef8a
......@@ -607,14 +607,18 @@ class SchedulerAPI(ExposedAPI):
raise xmlrpclib.Fault(404, "Specified job not found.")
if job.is_pipeline:
return job.get_status_display()
return {
'job_status': job.get_status_display(),
'bundle_sha1': ""
}
# DEPRECATED
bundle_sha1 = ""
try:
bundle_sha1 = job.results_link.split('/')[-2]
except IndexError:
pass
if job.results_link:
try:
bundle_sha1 = job.results_link.split('/')[-2]
except IndexError:
pass
job_status = {
'job_status': job.get_status_display(),
......
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