Commit 269aab6e authored by Mac Newbold's avatar Mac Newbold

Fix console setup calls.

parent 9902db70
......@@ -70,10 +70,6 @@ if (!$error && @vals) {
$cmd = "insert into reserved (node_id,pid,eid) values ".join(",",@vals);
if ($sth = $dbh->query($cmd)) {
print "Succeeded.\n";
foreach $n ( @nodes ) {
system("$consetup $n") == 0 or
print STDERR "WARNING: $consetup $n failed!\n";
}
} else {
print "Failed Command:\n$cmd\nError string is:".$dbh->errstr."\n";
$error++;
......@@ -85,4 +81,14 @@ $cmd = "unlock tables";
$sth = $dbh->query($cmd)
|| die("Locking error:\n$cmd\nError string is:".$dbh->errstr."\n");
if (!$error && @nodes) {
foreach $n ( @nodes ) {
print "Setting up console for $n...\n";
system("$consetup $n") == 0 or
print STDERR "WARNING: $consetup $n failed!\n";
}
}
print "Done.\n";
exit($error);
......@@ -23,9 +23,7 @@ my $reloadeid="reloading";
my $pid = shift;
my $eid = shift;
my @node_names=@ARGV;
my @machines = @node_names;
foreach my $m (@machines) { $m = "node_id='".$m."'"; }
my $list= join(" or ",@machines);
my @freed_nodes=();
my $cmd = "";
my $sth = "";
......@@ -55,12 +53,14 @@ if ($#node_names == -1) {
my %reloads = ();
foreach my $n (@node_names) {
$sth = $dbh->query("select * from reserved where node_id='$n' ".
"and eid='$eid'");
"and eid='$eid' and pid='$pid'");
if ($sth->numrows == 0) {
print "Node '$n' is not reserved by your experiment.\n";
$error++;
next;
}
} else {
push(@freed_nodes,$n);
}
# If the node has a reloads entry, change the reservation and start it
$cmd = "select node_id,partition,image_id,path from reloads where ".
......@@ -111,9 +111,6 @@ foreach my $n (@node_names) {
|| (print "Failed Command:\n$cmd\nError string is:".$dbh->errstr."\n"
&& $error++);
}
system("$consetup $n") == 0 or
print STDERR "WARNING: $consetup $n failed!\n";
}
print "Unlocking tables.\n";
......@@ -155,4 +152,12 @@ if ( %reloads > 0 ) {
|| die("Locking error:\n$cmd\nError string is:".$dbh->errstr."\n");
}
foreach $n ( @freed_nodes ) {
print "Setting up console for $n...\n";
system("$consetup $n") == 0 or
print STDERR "WARNING: $consetup $n failed!\n";
}
print "Done.\n";
exit($error);
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