Commit b7bda72e authored by Weibin Sun's avatar Weibin Sun

more merge with emulab-devel

parent 4183e16e
......@@ -588,7 +588,8 @@ sub LookupByWireType($$)
my @ports = ();
my $result = DBQueryFatal("SELECT node_id1, card1, port1, " .
"node_id2, card2, port2 FROM wires WHERE type='$wt'");
"node_id2, card2, port2 FROM wires ".
"WHERE type='$wt' and logical=0");
if ($result) {
while (my @row = $result->fetchrow()) {
......
......@@ -48,7 +48,6 @@ use libtestbed;
use Experiment;
use User;
use snmpit_lib;
use Port;
# The set of OIDs we care about
my @oids = ('ifAdminStatus','ifOperStatus');
......@@ -151,11 +150,12 @@ foreach my $name (keys %portMap) {
#
# Try to translate the port name to the node's vname
#
$port =~ /^(.+):(\d+)/;
my $nickname;
if (defined($port->node_id())) {
my $portnum = $port->port();
if ($1) {
my $portnum = $2;
my ($junk, $vname);
NodeidToExp($port->node_id(),\$junk,\$junk,\$vname);
NodeidToExp($1,\$junk,\$junk,\$vname);
$nickname = "$vname:$portnum";
}
......@@ -173,8 +173,7 @@ my $errors = 0;
foreach my $line (sort {$$a[0] cmp $$b[0]} @portinfo) {
my ($nickname,$port,$adminStatus,$operStatus) = @$line;
if ($adminStatus ne $operStatus) {
print "Switch port for $nickname (".$port->toString().
") should be $adminStatus, " .
print "Switch port for $nickname ($port) should be $adminStatus, " .
"but is $operStatus\n";
$errors++;
}
......
......@@ -31,7 +31,6 @@ use lib '@prefix@/lib';
use libdb;
use snmpit_lib;
use libtblog;
use Port;
use English;
use Getopt::Long;
......@@ -336,11 +335,16 @@ DEVICE: foreach my $name (keys %portMap) {
#
# Figure out which port on which switch this corresponds to
#
my $switchport = $port->getSwitchPort()?
$port->getSwitchPort():undef;
if (!$switchport) {
warn "WARNING: No switch port found for ".$port->toString()."\n";
my $switchport;
if ($opt{s}) {
if ($port =~ /^([^.]+)\.(\d+)\/(\d+)$/) {
$switchport = "$1:$2.$3";
}
} else {
$switchport = portnum($port);
}
if (!($switchport && ($switchport =~ /(.+):(\d+)\.(\d+)/))) {
warn "WARNING: No switch port found for $port\n";
} else {
my ($switch_id,$switch_card,$switch_port) = ($1, $2, $3);
my $dbresult = DBQueryFatal("select * from port_counters where ".
......
......@@ -33,7 +33,6 @@ use snmpit_nortel;
use snmpit_hp;
use SNMP;
use Getopt::Long;
use Port;
use strict;
......
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