All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 0d4f2d5e authored by Leigh B Stoller's avatar Leigh B Stoller

Create missing interface_state rows.

parent 7a2d0d78
......@@ -101,7 +101,8 @@ while (my ($node_id,$card,$port) = $query_result->fetchrow_array()) {
$ifaces{"$node_id:$card:$port"} = $interface;
my $node = Node->Lookup($node_id);
if (!exists($ifaces{"$node_id:$card:$port"}) && $node->role() eq "testnode") {
if (!exists($wires{"$node_id:$card:$port"}) &&
$node->role() eq "testnode") {
print STDERR "No wires row for $interface\n";
}
}
......@@ -149,7 +150,7 @@ foreach my $interface (values(%ifaces)) {
#
if (defined($interface->state())) {
if ($interface->state()->{'iface'} eq "") {
print STDERR "No iface set for $interface interface_state\n";
print STDERR "No iface set for $interface in interface_state\n";
if ($impotent) {
print STDERR "--> Would set it to $iface\n";
}
......@@ -167,6 +168,22 @@ foreach my $interface (values(%ifaces)) {
"$interface (" . $interface->state()->{'iface'} . ")");
}
}
else {
#
# Must be an interface_state for every interface.
#
if ($impotent) {
print STDERR "Would create missing interface_state for ".
"$nodeid:$iface\n";
}
else {
print STDERR "Creating missing interface_state for ".
"$nodeid:$iface\n";
DBQueryFatal("insert into interface_state set ".
" node_id='$nodeid',card='$card',".
" port='$port',iface='$iface'");
}
}
my $ifacename = $interface->node_id() . ":" . $interface->iface();
if (exists($ifacenames{$ifacename})) {
......
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