aboutsummaryrefslogtreecommitdiff
path: root/lava_scheduler_tool/commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'lava_scheduler_tool/commands.py')
-rw-r--r--lava_scheduler_tool/commands.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/lava_scheduler_tool/commands.py b/lava_scheduler_tool/commands.py
index 5844538..3529617 100644
--- a/lava_scheduler_tool/commands.py
+++ b/lava_scheduler_tool/commands.py
@@ -149,3 +149,25 @@ class job_status(Command):
print "Job ID: %s\nJob Status: %s\nBundle SHA1: %s" % \
(str(self.args.JOB_ID), job_status['job_status'],
job_status['bundle_sha1'])
+
+
+class job_details(Command):
+ """
+ Get job details, if it existed, from the scheduler.
+ """
+
+ @classmethod
+ def register_arguments(cls, parser):
+ super(job_details, cls).register_arguments(parser)
+ parser.add_argument("SERVER")
+ parser.add_argument("JOB_ID",
+ help="Job ID to find the details")
+
+ def invoke(self):
+ server = AuthenticatingServerProxy(
+ self.args.SERVER, auth_backend=KeyringAuthBackend())
+ job_details = server.scheduler.job_details(self.args.JOB_ID)
+
+ print "Details of job {0}: \n".format(str(self.args.JOB_ID))
+ for detail in job_details:
+ print "%s: %s" % (detail, job_details[detail])