Commit 67cc9252 authored by Mac Newbold's avatar Mac Newbold
Browse files

Added testmode. Won't update the database for netdisking, and won't reboot...

Added testmode. Won't update the database for netdisking, and won't reboot nodes. Will update partitions table as if the change had already happened.
parent ae4a7e2b
......@@ -29,6 +29,7 @@ my $optlist = "sld";
# Configure variables
#
my $TB = "@prefix@";
my $TESTMODE = @TESTMODE@;
#
# Load the Testbed support stuff.
......@@ -175,9 +176,11 @@ foreach my $node (@nodes) {
my $pc = $node;
print STDOUT "Changing default OS for $pc to $defosid\n";
DBQueryFatal("update nodes set ".
"def_boot_osid='$defosid',def_boot_path='' ".
"where node_id='$pc'");
if (!$TESTMODE) {
DBQueryFatal("update nodes set ".
"def_boot_osid='$defosid',def_boot_path='' ".
"where node_id='$pc'");
}
#
# Assign partition table entries for each partition in the image.
......@@ -207,16 +210,18 @@ foreach my $node (@nodes) {
}
print STDOUT "Setting up reload for $pc\n";
DBQueryFatal("update nodes set ".
"next_boot_osid='$NETDISKOSID',".
"next_boot_cmd_line='$cmdline' ".
"where node_id='$pc'");
if (!$TESTMODE) {
DBQueryFatal("update nodes set ".
"next_boot_osid='$NETDISKOSID',".
"next_boot_cmd_line='$cmdline' ".
"where node_id='$pc'");
}
}
#
# Fire off a reboot.
#
if (! $setuponly) {
if (! $setuponly && ! $TESTMODE ) {
system("$nodereboot @nodes");
$failures = $? >> 8;
}
......
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