Commit 0226e083 authored by Mike Hibler's avatar Mike Hibler

Minor tweaks:

dhcpd_makeconf.in: leave the hostname setting for plabinelab nodes
nfree.in: make sure that if we free a plabinelab or elabinelab node,
          that we reset the dhcpd.conf file
parent 088c8e74
......@@ -235,9 +235,18 @@ while (<IF>) {
$row{"plab_role"} eq "node"))) {
my $tag = $row{"pid"} . ":" . $row{"eid"};
$next_server = "${spaces}\tnext-server " .
$servernodes{$tag} . ";\n";
if ($row{"inner_elab_boot"} == 1) {
#
# XXX it is not yet completely clear what all we
# need to do, or not do, for plab nodes.
#
if ($row{"plab_boot"} == 1) {
$hostname =
"${spaces}\toption host-name \"$node_id\";\n";
$next_server = "${spaces}\tnext-server " .
$servernodes{$tag} . ";\n";
} else {
$next_server = "${spaces}\tnext-server " .
$servernodes{$tag} . ";\n";
$dns = "${spaces}\toption domain-name-servers ".
"1.1.1.1;\n";
}
......
......@@ -139,6 +139,8 @@ if (@ARGV) {
}
}
my $mustmakeconf = 0;
######################################################################
# Step 1
#
......@@ -203,6 +205,18 @@ foreach my $n (@nodes) {
print "*** WARNING: Error locking down node $n!\n";
next;
}
# Any node that was part of an elabinelab or plabinelab experiment
# that is freed requires that we remake the dhcpd.conf file.
if ($rowref->{'inner_elab_boot'} || $rowref->{'plab_boot'}) {
if (!DBQueryWarn("update reserved " .
"set inner_elab_boot=0, plab_boot=0 " .
"where node_id='$n'")) {
print "*** WARNING: Error clearing elab/plab boot on $n!\n";
}
$mustmakeconf = 1;
}
push(@freed_nodes, $n);
}
......@@ -234,10 +248,13 @@ if (@freed_nodes > 0) {
if ($result->num_rows()) {
DBQueryFatal("update nodes set pxe_boot_path=NULL where ".
"node_id in $nodelist");
system("$makeconf -i -r") == 0 ||
print STDERR "WARNING: $makeconf failed!\n";
$mustmakeconf = 1;
}
}
if ($mustmakeconf) {
system("$makeconf -i -r") == 0 ||
print STDERR "WARNING: $makeconf failed!\n";
}
######################################################################
# Step 2
......
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