Merge lp:~arthur-she/lava-tool/add-job-status-command into lp:~linaro-validation/lava-tool/trunk

Proposed by Arthur She
Status: Merged
Approved by: Senthil Kumaran S
Approved revision: 187
Merged at revision: 187
Proposed branch: lp:~arthur-she/lava-tool/add-job-status-command
Merge into: lp:~linaro-validation/lava-tool/trunk
Diff against target: 50 lines (+25/-0)
2 files modified
entry_points.ini (+2/-0)
lava_scheduler_tool/commands.py (+23/-0)
To merge this branch: bzr merge lp:~arthur-she/lava-tool/add-job-status-command
Reviewer Review Type Date Requested Status
Senthil Kumaran S Approve
Review via email: mp+172981@code.launchpad.net

Description of the change

Add job-status command

To post a comment you must log in.
Revision history for this message
Senthil Kumaran S (stylesen) wrote :

Looks good. Approved.

review: Approve
Revision history for this message
Arthur She (arthur-she) wrote :

Thanks, Senthil :)

2013/7/4 Senthil Kumaran S <email address hidden>

> The proposal to merge lp:~arthur-she/lava-tool/add-job-status-command into
> lp:lava-tool has been updated.
>
> Status: Needs review => Approved
>
> For more details, see:
>
> https://code.launchpad.net/~arthur-she/lava-tool/add-job-status-command/+merge/172981
> --
>
> https://code.launchpad.net/~arthur-she/lava-tool/add-job-status-command/+merge/172981
> You are the owner of lp:~arthur-she/lava-tool/add-job-status-command.
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'entry_points.ini'
2--- entry_points.ini 2013-05-27 20:51:39 +0000
3+++ entry_points.ini 2013-07-04 09:33:27 +0000
4@@ -16,6 +16,7 @@
5 resubmit-job = lava_scheduler_tool.commands:resubmit_job
6 cancel-job = lava_scheduler_tool.commands:cancel_job
7 job-output = lava_scheduler_tool.commands:job_output
8+job-status = lava_scheduler_tool.commands:job_status
9 backup=lava_dashboard_tool.commands:backup
10 bundles=lava_dashboard_tool.commands:bundles
11 data_views=lava_dashboard_tool.commands:data_views
12@@ -35,6 +36,7 @@
13 resubmit-job = lava_scheduler_tool.commands:resubmit_job
14 cancel-job = lava_scheduler_tool.commands:cancel_job
15 job-output = lava_scheduler_tool.commands:job_output
16+job-status = lava_scheduler_tool.commands:job_status
17
18 [lava.dashboard.commands]
19 backup=lava_dashboard_tool.commands:backup
20
21=== modified file 'lava_scheduler_tool/commands.py'
22--- lava_scheduler_tool/commands.py 2013-04-22 17:23:45 +0000
23+++ lava_scheduler_tool/commands.py 2013-07-04 09:33:27 +0000
24@@ -132,3 +132,26 @@
25
26 print "Downloaded job output of {0} to file {1!r}".format(
27 self.args.JOB_ID, filename)
28+
29+
30+class job_status(Command):
31+ """
32+ Get job status and bundle sha1, if it existed, from the scheduler.
33+ """
34+
35+ @classmethod
36+ def register_arguments(cls, parser):
37+ super(job_status, cls).register_arguments(parser)
38+ parser.add_argument("SERVER")
39+ parser.add_argument("JOB_ID",
40+ type=int,
41+ help="Job ID to check the status")
42+
43+ def invoke(self):
44+ server = AuthenticatingServerProxy(
45+ self.args.SERVER, auth_backend=KeyringAuthBackend())
46+ job_status = server.scheduler.job_status(self.args.JOB_ID)
47+
48+ print "Job ID: %d\nJob Status: %s\nBundle SHA1: %s" %(self.args.JOB_ID,
49+ job_status['job_status'], job_status['bundle_sha1'])
50+

Subscribers

People subscribed via source and target branches