Commit 822bfafc authored by Leigh B Stoller's avatar Leigh B Stoller

Get rid of legacy Interface lookup by card,port

parent 6c285ab0
......@@ -378,7 +378,7 @@ while (1) {
my @fakenodenames = ();
my @switchnodenames = ();
my %fakenodemap = ();
my $query_result = emdbi::DBQueryWarnN( $tbdb, "SELECT e.node_id, w.node_id1, w.card1, w.port1, w.node_id2, w.card2, w.port2 " .
my $query_result = emdbi::DBQueryWarnN( $tbdb, "SELECT e.node_id, w.node_id1, w.iface1, w.node_id2, w.card2, w.port2 " .
"FROM external_networks as e, " .
"wires as w WHERE " .
"e.node_id=w.node_id1 OR " .
......@@ -387,18 +387,14 @@ while (1) {
my @fakenodes;
while( @fakenodes = $query_result->fetchrow_array() ) {
my ($external, $node1, $card1, $port1, $node2, $card2, $port2) = @fakenodes;
my ($external, $node1, $iface1, $node2, $card2, $port2) = @fakenodes;
my $extnode = $external eq $node1 ? $node1 : $node2;
my $extcard = $external eq $node1 ? $card1 : $card2;
my $extport = $external eq $node1 ? $port1 : $port2;
my $extiface = $external eq $node1 ? $iface1 : $iface2;
my $switchnode = $external eq $node1 ? $node2 : $node1;
my $switchcard = $external eq $node1 ? $card2 : $card1;
my $switchport = $external eq $node1 ? $port2 : $port1;
my $iface = Interface->Lookup( $extnode, $extcard, $extport );
my $ifacename = $iface->iface();
$fakenodemap{ "$extnode:$ifacename" } =
$fakenodemap{ "$extnode:$extiface" } =
"$switchnode:$switchcard:$switchport";
next if grep { $_ eq $switchnode } @switchnodenames;
......
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