Merge lp:~stylesen/lava-scheduler/fix-bug-1224260 into lp:lava-scheduler

Proposed by Senthil Kumaran S on 2013-09-12
Status: Merged
Approved by: Senthil Kumaran S on 2013-09-12
Approved revision: 263
Merged at revision: 263
Proposed branch: lp:~stylesen/lava-scheduler/fix-bug-1224260
Merge into: lp:lava-scheduler
Diff against target: 28 lines (+9/-3)
1 file modified
lava_scheduler_app/utils.py (+9/-3)
To merge this branch: bzr merge lp:~stylesen/lava-scheduler/fix-bug-1224260
Reviewer Review Type Date Requested Status
Neil Williams 2013-09-12 Approve on 2013-09-12
Review via email: mp+185211@code.launchpad.net

Description of the change

Fix bug #1224260 - split_multi_job makes assumptions about the job JSON that are not enforced by the schema.

Respect parameters that are marked as optional in the job schema.

To post a comment you must log in.
Neil Williams (codehelp) wrote :

Looks good, thanks.

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-02 16:22:57 +0000
3+++ lava_scheduler_app/utils.py 2013-09-12 07:14:16 +0000
4@@ -81,15 +81,21 @@
5 for c in range(0, count):
6 node_json[role].append({})
7 node_json[role][c]["timeout"] = json_jobdata["timeout"]
8- node_json[role][c]["job_name"] = json_jobdata["job_name"]
9- node_json[role][c]["tags"] = clients["tags"]
10+ if json_jobdata.get("job_name", False):
11+ node_json[role][c]["job_name"] = json_jobdata["job_name"]
12+ if clients.get("tags", False):
13+ node_json[role][c]["tags"] = clients["tags"]
14 node_json[role][c]["group_size"] = group_count
15 node_json[role][c]["target_group"] = target_group
16 node_json[role][c]["actions"] = node_actions[role]
17
18 node_json[role][c]["role"] = role
19 # multinode node stage 2
20- node_json[role][c]["logging_level"] = json_jobdata["logging_level"]
21+ if json_jobdata.get("logging_level", False):
22+ node_json[role][c]["logging_level"] = \
23+ json_jobdata["logging_level"]
24+ if json_jobdata.get("priority", False):
25+ node_json[role][c]["priority"] = json_jobdata["priority"]
26 node_json[role][c]["device_type"] = clients["device_type"]
27
28 return node_json

Subscribers

People subscribed via source and target branches