diff mbox

[Branch,~linaro-validation/lava-tool/trunk] Rev 187: "[r=stylesen][bug=][author=arthur-she] automatic merge by tarmac"

Message ID 20130705143613.2882.34490.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

tarmac July 5, 2013, 2:36 p.m. UTC
Merge authors:
  Arthur She (arthur-she)
Related merge proposals:
  https://code.launchpad.net/~arthur-she/lava-tool/add-job-status-command/+merge/172981
  proposed by: Arthur She (arthur-she)
  review: Approve - Senthil Kumaran S (stylesen)
------------------------------------------------------------
revno: 187 [merge]
author: Arthur She <arthur.she@linaro.org>
committer: Tarmac
branch nick: lava-tool
timestamp: Fri 2013-07-05 15:35:51 +0100
message:
  "[r=stylesen][bug=][author=arthur-she] automatic merge by tarmac"
modified:
  entry_points.ini
  lava_scheduler_tool/commands.py


--
lp:lava-tool
https://code.launchpad.net/~linaro-validation/lava-tool/trunk

You are subscribed to branch lp:lava-tool.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-tool/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'entry_points.ini'
--- entry_points.ini	2013-05-27 20:51:39 +0000
+++ entry_points.ini	2013-07-04 09:29:28 +0000
@@ -16,6 +16,7 @@ 
 resubmit-job = lava_scheduler_tool.commands:resubmit_job
 cancel-job = lava_scheduler_tool.commands:cancel_job
 job-output = lava_scheduler_tool.commands:job_output
+job-status = lava_scheduler_tool.commands:job_status
 backup=lava_dashboard_tool.commands:backup
 bundles=lava_dashboard_tool.commands:bundles
 data_views=lava_dashboard_tool.commands:data_views
@@ -35,6 +36,7 @@ 
 resubmit-job = lava_scheduler_tool.commands:resubmit_job
 cancel-job = lava_scheduler_tool.commands:cancel_job
 job-output = lava_scheduler_tool.commands:job_output
+job-status = lava_scheduler_tool.commands:job_status
 
 [lava.dashboard.commands]
 backup=lava_dashboard_tool.commands:backup

=== modified file 'lava_scheduler_tool/commands.py'
--- lava_scheduler_tool/commands.py	2013-04-22 17:23:45 +0000
+++ lava_scheduler_tool/commands.py	2013-07-04 09:29:28 +0000
@@ -132,3 +132,26 @@ 
 
         print "Downloaded job output of {0} to file {1!r}".format(
             self.args.JOB_ID, filename)
+
+
+class job_status(Command):
+    """
+    Get job status and bundle sha1, if it existed, from the scheduler.
+    """
+
+    @classmethod
+    def register_arguments(cls, parser):
+        super(job_status, cls).register_arguments(parser)
+        parser.add_argument("SERVER")
+        parser.add_argument("JOB_ID",
+                            type=int,
+                            help="Job ID to check the status")
+
+    def invoke(self):
+        server = AuthenticatingServerProxy(
+            self.args.SERVER, auth_backend=KeyringAuthBackend())
+        job_status = server.scheduler.job_status(self.args.JOB_ID)
+
+        print "Job ID: %d\nJob Status: %s\nBundle SHA1: %s" %(self.args.JOB_ID,
+               job_status['job_status'], job_status['bundle_sha1'])
+