Merge lp:~codehelp/lava-scheduler/regression-1202285 into lp:lava-scheduler

Proposed by Neil Williams
Status: Merged
Approved by: Neil Williams
Approved revision: 256
Merged at revision: 258
Proposed branch: lp:~codehelp/lava-scheduler/regression-1202285
Merge into: lp:lava-scheduler
Prerequisite: lp:~codehelp/lava-scheduler/reserved-boards
Diff against target: 13 lines (+4/-1)
1 file modified
lava_scheduler_app/utils.py (+4/-1)
To merge this branch: bzr merge lp:~codehelp/lava-scheduler/regression-1202285
Reviewer Review Type Date Requested Status
Antonio Terceiro Approve
Review via email: mp+183498@code.launchpad.net

Description of the change

Ensure that the count of devices in roles which use the same device_type as another role is aggregated, not ignored.

This branch will only be merged once lp:~codehelp/lava-scheduler/reserved-boards is merged and tested as this patch makes it harder to reproduce the issue behind #1219236 without fixing that bug.

To post a comment you must log in.
Revision history for this message
Antonio Terceiro (terceiro) wrote :

Good catch!

 review approve

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-08-28 09:34:40 +0000
3+++ lava_scheduler_app/utils.py 2013-09-02 16:30:39 +0000
4@@ -113,5 +113,8 @@
5 for device_group in job_data['device_group']:
6 device_type = device_group['device_type']
7 count = device_group['count']
8- requested_devices[device_type] = count
9+ if device_type in requested_devices:
10+ requested_devices[device_type] += count
11+ else:
12+ requested_devices[device_type] = count
13 return requested_devices

Subscribers

People subscribed via source and target branches