[Branch,~linaro-validation/lava-scheduler/trunk] Rev 258: Neil Williams 2013-09-02 Fix regression in #1202285

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

Commit Message

Neil Williams Sept. 3, 2013, 11:41 a.m.
Merge authors:
  Neil Williams (codehelp)
Related merge proposals:
  https://code.launchpad.net/~codehelp/lava-scheduler/regression-1202285/+merge/183498
  proposed by: Neil Williams (codehelp)
  review: Approve - Antonio Terceiro (terceiro)
------------------------------------------------------------
revno: 258 [merge]
committer: Neil Williams <neil.williams@linaro.org>
branch nick: lava-scheduler
timestamp: Tue 2013-09-03 12:39:38 +0100
message:
  Neil Williams 2013-09-02 Fix regression in #1202285
   by ensuring that the count of devices in roles which use the
   same device_type as another role is aggregated, not ignored.
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

Patch

=== modified file 'lava_scheduler_app/utils.py'
--- lava_scheduler_app/utils.py	2013-08-28 09:34:40 +0000
+++ lava_scheduler_app/utils.py	2013-09-02 16:22:57 +0000
@@ -113,5 +113,8 @@ 
         for device_group in job_data['device_group']:
             device_type = device_group['device_type']
             count = device_group['count']
-            requested_devices[device_type] = count
+            if device_type in requested_devices:
+                requested_devices[device_type] += count
+            else:
+                requested_devices[device_type] = count
     return requested_devices