aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Williams <neil.williams@linaro.org>2016-12-02 13:09:40 +0000
committerSenthil Kumaran S <senthil.kumaran@linaro.org>2016-12-05 06:52:45 +0000
commit0c468c332662227eb65791c345653b4403b00987 (patch)
tree3ab88e408b3e5c92ada4584698d10bb6fb4daed7
parent6da61446328677ad9697edc34ef6355f2ad1ed1f (diff)
Allow for older instances in submit_job url
Retain older behaviour when submitting to instances which have not upgraded the scheduler api to include the absolute_url. Change-Id: Idd02fd1288924646450a49da3b9d9e7da38d62a3 Reviewed-on: https://review.linaro.org/16038 Reviewed-by: lava-bot <lava-bot@linaro.org> Reviewed-by: Senthil Kumaran S <senthil.kumaran@linaro.org>
-rw-r--r--lava_scheduler_tool/commands.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/lava_scheduler_tool/commands.py b/lava_scheduler_tool/commands.py
index d5a820f..a07e9b2 100644
--- a/lava_scheduler_tool/commands.py
+++ b/lava_scheduler_tool/commands.py
@@ -110,11 +110,17 @@ class submit_job(Command):
print "submitted as jobs:"
for job_id in job_ids:
job = server.scheduler.job_details(job_id)
- print urlparse.urljoin(host, job["absolute_url"])
+ if 'absolute_url' in job:
+ print urlparse.urljoin(host, job["absolute_url"])
+ else:
+ print " -", job_id
else:
job = server.scheduler.job_details(job_ids)
- print "submitted as job:", urlparse.urljoin(
- host, job["absolute_url"])
+ if 'absolute_url' in job:
+ print "submitted as job:", urlparse.urljoin(
+ host, job["absolute_url"])
+ else:
+ print "submitted as job:", job_ids
job_ids = [job_ids]
if self.args.block: