Merge lp:~pwlars/lava-scheduler-tool/resubmit-command into lp:lava-scheduler-tool

Proposed by Paul Larson
Status: Merged
Merged at revision: 18
Proposed branch: lp:~pwlars/lava-scheduler-tool/resubmit-command
Merge into: lp:lava-scheduler-tool
Diff against target: 45 lines (+21/-0)
2 files modified
lava_scheduler_tool/commands.py (+19/-0)
setup.py (+2/-0)
To merge this branch: bzr merge lp:~pwlars/lava-scheduler-tool/resubmit-command
Reviewer Review Type Date Requested Status
Paul Larson (community) Needs Resubmitting
Review via email: mp+100727@code.launchpad.net

Description of the change

*sigh* it helps if you remember to commit the branch before running lp-propose... anyway, here it is for real this time

Here's the lava-scheduler-tool command to go with the resubmit api. I haven't actually tried this yet, but seems straightforward enough.

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

20 + job_id = server.scheduler.submit_job(self.args.JOB_ID)

I guess you wanted resubmit_job() here.

PS: since this depends on server api bump we should also wrap this with some checks for missing method error.

17. By Paul Larson

s/submit/resubmit

Revision history for this message
Paul Larson (pwlars) wrote :

> 20 + job_id = server.scheduler.submit_job(self.args.JOB_ID)
>
> I guess you wanted resubmit_job() here.
oops, typo :)

>
> PS: since this depends on server api bump we should also wrap this with some
> checks for missing method error.
This should already be caught in the try/except block and result in:
ERROR: <Fault -32601: "No such method: u'scheduler.resubmit_job'">

Tested this locally, seems to work.

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lava_scheduler_tool/commands.py'
--- lava_scheduler_tool/commands.py 2012-04-04 03:58:51 +0000
+++ lava_scheduler_tool/commands.py 2012-05-09 05:40:24 +0000
@@ -57,6 +57,25 @@
57 print "submitted as job id:", job_id57 print "submitted as job id:", job_id
5858
5959
60class resubmit_job(ExperimentalCommandMixIn, Command):
61
62 @classmethod
63 def register_arguments(self, parser):
64 parser.add_argument("SERVER")
65 parser.add_argument("JOB_ID", type=int)
66
67 def invoke(self):
68 self.print_experimental_notice()
69 server = AuthenticatingServerProxy(
70 self.args.SERVER, auth_backend=KeyringAuthBackend())
71 try:
72 job_id = server.scheduler.resubmit_job(self.args.JOB_ID)
73 except xmlrpclib.Fault, e:
74 raise CommandError(str(e))
75 else:
76 print "resubmitted as job id:", job_id
77
78
60class cancel_job(ExperimentalCommandMixIn, Command):79class cancel_job(ExperimentalCommandMixIn, Command):
6180
62 @classmethod81 @classmethod
6382
=== modified file 'setup.py'
--- setup.py 2012-03-22 18:16:16 +0000
+++ setup.py 2012-05-09 05:40:24 +0000
@@ -36,9 +36,11 @@
36 scheduler = lava_scheduler_tool.commands:scheduler36 scheduler = lava_scheduler_tool.commands:scheduler
37 [lava.scheduler.commands]37 [lava.scheduler.commands]
38 submit-job = lava_scheduler_tool.commands:submit_job38 submit-job = lava_scheduler_tool.commands:submit_job
39 resubmit-job = lava_scheduler_tool.commands:resubmit_job
39 cancel-job = lava_scheduler_tool.commands:cancel_job40 cancel-job = lava_scheduler_tool.commands:cancel_job
40 [lava_tool.commands]41 [lava_tool.commands]
41 submit-job = lava_scheduler_tool.commands:submit_job42 submit-job = lava_scheduler_tool.commands:submit_job
43 resubmit-job = lava_scheduler_tool.commands:resubmit_job
42 cancel-job = lava_scheduler_tool.commands:cancel_job44 cancel-job = lava_scheduler_tool.commands:cancel_job
43 """,45 """,
44 classifiers=[46 classifiers=[

Subscribers

People subscribed via source and target branches