Commit e696c5b5 authored by Robert Ricci's avatar Robert Ricci
Browse files

(Really commited by newbold, but I am paperbagged) Added stuff to clean up IPs...

(Really commited by newbold, but I am paperbagged) Added stuff to clean up IPs from the interfaces table. Removes all IPs for each node except the control_net card, as defined in node_types.
parent e1b4c031
......@@ -49,6 +49,17 @@ foreach my $n (@node_names) {
$sth = $dbh->query($cmd) && print "Succeeded.\n"
|| (print "Failed Command:\n$cmd\nError string is:".$dbh->errstr."\n"
&& $error++);
# Find the control net interface for this node type
$sth = $dbh->query("select control_net from node_types as t left join ".
"nodes as n on n.type=t.type where node_id='$n'");
my @row= $sth->fetchrow_array();
my $control= $row[0];
print "Got Control $control\n";
$cmd = "update interfaces set IP='' where node_id='$n' and card!='$control'";
$sth = $dbh->query($cmd)
|| (print "Failed Command:\n$cmd\nError string is:".$dbh->errstr."\n"
&& $error++);
}
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