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
=== modified file 'lava_scheduler_app/utils.py'
--- lava_scheduler_app/utils.py 2013-09-12 07:07:01 +0000
+++ lava_scheduler_app/utils.py 2013-09-12 08:52:25 +0000
@@ -22,7 +22,7 @@
22import socket22import socket
23import urlparse23import urlparse
24import simplejson24import simplejson
2525from models import JSONDataError
2626
27def rewrite_hostname(result_url):27def rewrite_hostname(result_url):
28 """If URL has hostname value as localhost/127.0.0.*, change it to the28 """If URL has hostname value as localhost/127.0.0.*, change it to the
@@ -74,6 +74,8 @@
74 group_count = 074 group_count = 0
75 for clients in json_jobdata["device_group"]:75 for clients in json_jobdata["device_group"]:
76 group_count += int(clients["count"])76 group_count += int(clients["count"])
77 if group_count <= 1:
78 raise JSONDataError("Only one device requested in a MultiNode job submission.")
77 for clients in json_jobdata["device_group"]:79 for clients in json_jobdata["device_group"]:
78 role = str(clients["role"])80 role = str(clients["role"])
79 count = int(clients["count"])81 count = int(clients["count"])

Subscribers

People subscribed via source and target branches