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

Proposed by Senthil Kumaran S
Status: Merged
Approved by: Senthil Kumaran S
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 Approve
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.
Revision history for this message
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
=== modified file 'lava_scheduler_app/utils.py'
--- lava_scheduler_app/utils.py 2013-09-02 16:22:57 +0000
+++ lava_scheduler_app/utils.py 2013-09-12 07:14:16 +0000
@@ -81,15 +81,21 @@
81 for c in range(0, count):81 for c in range(0, count):
82 node_json[role].append({})82 node_json[role].append({})
83 node_json[role][c]["timeout"] = json_jobdata["timeout"]83 node_json[role][c]["timeout"] = json_jobdata["timeout"]
84 node_json[role][c]["job_name"] = json_jobdata["job_name"]84 if json_jobdata.get("job_name", False):
85 node_json[role][c]["tags"] = clients["tags"]85 node_json[role][c]["job_name"] = json_jobdata["job_name"]
86 if clients.get("tags", False):
87 node_json[role][c]["tags"] = clients["tags"]
86 node_json[role][c]["group_size"] = group_count88 node_json[role][c]["group_size"] = group_count
87 node_json[role][c]["target_group"] = target_group89 node_json[role][c]["target_group"] = target_group
88 node_json[role][c]["actions"] = node_actions[role]90 node_json[role][c]["actions"] = node_actions[role]
8991
90 node_json[role][c]["role"] = role92 node_json[role][c]["role"] = role
91 # multinode node stage 293 # multinode node stage 2
92 node_json[role][c]["logging_level"] = json_jobdata["logging_level"]94 if json_jobdata.get("logging_level", False):
95 node_json[role][c]["logging_level"] = \
96 json_jobdata["logging_level"]
97 if json_jobdata.get("priority", False):
98 node_json[role][c]["priority"] = json_jobdata["priority"]
93 node_json[role][c]["device_type"] = clients["device_type"]99 node_json[role][c]["device_type"] = clients["device_type"]
94100
95 return node_json101 return node_json

Subscribers

People subscribed via source and target branches