Merge lp:~stylesen/lava-scheduler/multinode into lp:lava-scheduler/multinode

Proposed by Senthil Kumaran S
Status: Merged
Approved by: Neil Williams
Approved revision: no longer in the source branch.
Merged at revision: 276
Proposed branch: lp:~stylesen/lava-scheduler/multinode
Merge into: lp:lava-scheduler/multinode
Diff against target: 37 lines (+14/-2)
2 files modified
lava_scheduler_app/api.py (+7/-1)
lava_scheduler_app/views.py (+7/-1)
To merge this branch: bzr merge lp:~stylesen/lava-scheduler/multinode
Reviewer Review Type Date Requested Status
Neil Williams Approve
Review via email: mp+180509@code.launchpad.net

Description of the change

Add ability to cancel multinode jobs.

To post a comment you must log in.
Revision history for this message
Neil Williams (codehelp) wrote :

Approved, thanks.

review: Approve
276. By Neil Williams

Senthil Kumaran 2013-08-16 Add ability to cancel multinode jobs.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava_scheduler_app/api.py'
2--- lava_scheduler_app/api.py 2013-08-16 07:59:57 +0000
3+++ lava_scheduler_app/api.py 2013-08-16 09:30:49 +0000
4@@ -60,7 +60,13 @@
5 job = TestJob.objects.get(pk=job_id)
6 if not job.can_cancel(self.user):
7 raise xmlrpclib.Fault(403, "Permission denied.")
8- job.cancel()
9+ if job.target_group:
10+ multinode_jobs = TestJob.objects.all().filter(
11+ target_group=job.target_group)
12+ for multinode_job in multinode_jobs:
13+ multinode_job.cancel()
14+ else:
15+ job.cancel()
16 return True
17
18 def job_output(self, job_id):
19
20=== modified file 'lava_scheduler_app/views.py'
21--- lava_scheduler_app/views.py 2013-08-16 07:59:57 +0000
22+++ lava_scheduler_app/views.py 2013-08-16 09:30:49 +0000
23@@ -800,7 +800,13 @@
24 def job_cancel(request, pk):
25 job = get_restricted_job(request.user, pk)
26 if job.can_cancel(request.user):
27- job.cancel()
28+ if job.target_group:
29+ multinode_jobs = TestJob.objects.all().filter(
30+ target_group=job.target_group)
31+ for multinode_job in multinode_jobs:
32+ multinode_job.cancel()
33+ else:
34+ job.cancel()
35 return redirect(job)
36 else:
37 return HttpResponseForbidden(

Subscribers

People subscribed via source and target branches

to status/vote changes: