Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libjobspec: ensure task count has exactly one key #1343

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions resource/libjobspec/jobspec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ Task::Task (const YAML::Node &tasknode)
if (!count_node.IsMap ()) {
throw parse_error (count_node, "\"count\" in task is not a mapping");
}
if (count_node.size () != 1) {
throw parse_error (count_node, "\"count\" in task must have exactly one entry");
}
for (auto &&entry : count_node) {
count[entry.first.as<std::string> ()] = entry.second.as<std::string> ();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 9999
resources:
- type: slot
count: 1
label: foo
with:
- type: node
count: 1
tasks:
- command: [ "app" ]
slot: foo
count:
per_slot: 1
total: 1
attributes:
Loading