Merge lp:~codehelp/lava-scheduler/group-size-limit into lp:lava-scheduler

Proposed by Neil Williams
Status: Merged
Approved by: Senthil Kumaran S
Approved revision: 264
Merged at revision: 264
Proposed branch: lp:~codehelp/lava-scheduler/group-size-limit
Merge into: lp:lava-scheduler
Diff against target: 21 lines (+3/-1)
1 file modified
lava_scheduler_app/utils.py (+3/-1)
To merge this branch: bzr merge lp:~codehelp/lava-scheduler/group-size-limit
Reviewer Review Type Date Requested Status
Senthil Kumaran S Approve
Review via email: mp+185217@code.launchpad.net

Description of the change

Raise an exception if the group_size would be one or less in a MultiNode job.

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

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava_scheduler_app/utils.py'
2--- lava_scheduler_app/utils.py 2013-09-12 07:07:01 +0000
3+++ lava_scheduler_app/utils.py 2013-09-12 08:52:25 +0000
4@@ -22,7 +22,7 @@
5 import socket
6 import urlparse
7 import simplejson
8-
9+from models import JSONDataError
10
11 def rewrite_hostname(result_url):
12 """If URL has hostname value as localhost/127.0.0.*, change it to the
13@@ -74,6 +74,8 @@
14 group_count = 0
15 for clients in json_jobdata["device_group"]:
16 group_count += int(clients["count"])
17+ if group_count <= 1:
18+ raise JSONDataError("Only one device requested in a MultiNode job submission.")
19 for clients in json_jobdata["device_group"]:
20 role = str(clients["role"])
21 count = int(clients["count"])

Subscribers

People subscribed via source and target branches