Commit 718d7a2b authored by Mike Hibler's avatar Mike Hibler

Add optional param to ExpNodes to return only physical nodes.

Use that option in the undoFW function to make sure we don't try
to cleanup virtnodes.
parent e505c847
......@@ -1697,16 +1697,20 @@ sub ExpNodesOldReserved($$)
# If the optional flag is set, returns only local nodes.
# Returns 0 if an invalid pid/eid or if an error.
#
sub ExpNodes($$;$)
sub ExpNodes($$;$$)
{
my($pid, $eid, $flag) = @_;
my($pid, $eid, $localonly, $physonly) = @_;
my(@row);
my(@nodes);
my $clause = "";
if (defined($flag)) {
$clause = "and nt.isremotenode=0";
if (defined($localonly)) {
$clause .= " and nt.isremotenode=0";
}
if (defined($physonly)) {
$clause .= " and nt.isvirtnode=0";
}
my $query_result =
DBQueryWarn("select r.node_id from reserved as r ".
"left join nodes as n on n.node_id=r.node_id ".
......
......@@ -1457,7 +1457,7 @@ sub undoFWNodes($$;@) {
my $zap = 1;
if (!@nodes || scalar(@nodes) == 0) {
@nodes = ExpNodes($pid, $eid, 1);
@nodes = ExpNodes($pid, $eid, 1, 1);
$doall = 1;
}
......
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