Commit 292175ec authored by David Johnson's avatar David Johnson
Browse files

Warn on (and ignore) duplicate nodes in nodelist arg to osload.

(Invoking osload this way is a bug, but since libosload_new's wait
loop is a counter, we can't double-wait for any one node since each
node only finishes once (per image)... so we have to check this case,
otherwise the real problem is hard to debug.)
parent fde773c0
......@@ -445,13 +445,25 @@ sub osload($$$) {
#
# Although the object can support multiple osloads in flight at once,
# don't allow multiple reloads per node in different osload invocations!
# Also, remove duplicate nodes from the list and warn on them!
#
my %seen = ();
my @tmpnodes = ();
foreach my $node (@nodes) {
if (exists($self->{NODES}->{$node})) {
tberror "$self is already loading $node!\n";
return -1;
}
if (!exists($seen{$node})) {
$seen{$node} = 1;
push(@tmpnodes, $node);
}
else {
tbwarn("$self osload: Duplicate node '$node' in nodelist;".
" ignoring!\n");
}
}
@nodes = @tmpnodes;
# override our defaults
foreach my $flag (keys(%$args)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment