Commit 8555508d authored by Jonathon Duerig's avatar Jonathon Duerig

IP addresses now migrate from new_interfaces table to interfaces on commit.

Control and Outer Control interfaces IPs are overwritten by node IP and
outer_control_ip.
parent 341739ca
......@@ -188,7 +188,8 @@ my %ifacefields =
"port" => ["port", $SLOT_OPTIONAL, undef],
"mac" => ["mac", $SLOT_OPTIONAL, undef],
"type" => ["interface_type", $SLOT_OPTIONAL, undef],
"role" => ["role", $SLOT_OPTIONAL, undef]);
"role" => ["role", $SLOT_OPTIONAL, undef],
"IP" => ["IP", $SLOT_OPTIONAL, undef]);
my %wirefields =
# XML Field Name DB slot name Flags Default
......
......@@ -232,7 +232,7 @@ NODE: foreach my $node_id (@node_ids) {
# Grab the node's MACs from the new_interfaces table
#
$query_result = DBQueryFatal("SELECT card, MAC, interface_type, " .
"switch_id, switch_card, switch_port, cable, len, role, port " .
"switch_id, switch_card, switch_port, cable, len, role, port, IP " .
"FROM new_interfaces WHERE new_node_id='$new_node_id'");
if (!$query_result->num_rows()) {
warn "Node $node_id failed: Must have at least one interface!\n";
......@@ -241,7 +241,7 @@ NODE: foreach my $node_id (@node_ids) {
my %interfaces;
while (my ($card, $MAC, $iface_type, $switch_id, $switch_card,
$switch_port, $cable, $len, $ifrole, $port) = $query_result->fetchrow()) {
$switch_port, $cable, $len, $ifrole, $port, $iface_IP) = $query_result->fetchrow()) {
#
# Get some more information about this interface type
#
......@@ -273,7 +273,8 @@ NODE: foreach my $node_id (@node_ids) {
# Stash it away...
#
$interfaces{$card} = [$MAC, $iface_type, $max_speed, $full_duplex,
$switch_id, $switch_card, $switch_port, $cable, $len, $ifrole, $port];
$switch_id, $switch_card, $switch_port, $cable,
$len, $ifrole, $port, $iface_IP];
}
......@@ -445,9 +446,8 @@ NODE: foreach my $node_id (@node_ids) {
while (my ($card, $aref) = each %interfaces) {
my ($MAC, $iface_type, $max_speed, $duplex, $switch_id, $switch_card,
$switch_port, $cable, $len, $ifrole, $port) = @$aref;
$switch_port, $cable, $len, $ifrole, $port, $iface_IP) = @$aref;
my $iface = "eth$card";
my $iface_IP;
my $wire_type;
my $iface_role;
......@@ -474,9 +474,11 @@ NODE: foreach my $node_id (@node_ids) {
else {
# Experimental interfaces start with no speed set.
$max_speed = 0;
$iface_IP = "";
$wire_type = "Node";
}
if (! defined($iface_IP)) {
$iface_IP = "";
}
if (! $useScriptFeature)
{
......
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