diff mbox

[Branch,~linaro-validation/lava-scheduler/trunk] Rev 264: Neil Williams 2013-09-12 Fix #1224033 by raising an exception if the group_size would be one or l...

Message ID 20130912093124.27707.64217.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Neil Williams Sept. 12, 2013, 9:31 a.m. UTC
Merge authors:
  Neil Williams (codehelp)
Related merge proposals:
  https://code.launchpad.net/~codehelp/lava-scheduler/group-size-limit/+merge/185217
  proposed by: Neil Williams (codehelp)
  review: Approve - Senthil Kumaran S (stylesen)
------------------------------------------------------------
revno: 264 [merge]
committer: Neil Williams <neil.williams@linaro.org>
branch nick: lava-scheduler
timestamp: Thu 2013-09-12 10:30:32 +0100
message:
  Neil Williams 2013-09-12 Fix #1224033 by raising an exception if the group_size would be one or less in a MultiNode job.
   Fix import syntax of original MP.
modified:
  lava_scheduler_app/utils.py


--
lp:lava-scheduler
https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk

You are subscribed to branch lp:lava-scheduler.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk/+edit-subscription
diff mbox

Patch

=== 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 09:30:32 +0000
@@ -22,6 +22,7 @@ 
 import socket
 import urlparse
 import simplejson
+import models
 
 
 def rewrite_hostname(result_url):
@@ -74,6 +75,8 @@ 
     group_count = 0
     for clients in json_jobdata["device_group"]:
         group_count += int(clients["count"])
+    if group_count <= 1:
+        raise models.JSONDataError("Only one device requested in a MultiNode job submission.")
     for clients in json_jobdata["device_group"]:
         role = str(clients["role"])
         count = int(clients["count"])