Commit 8fa77458 authored by Weibin Sun's avatar Weibin Sun

merge portmerge

parent a00ec03b
......@@ -48,6 +48,7 @@ use libtestbed;
use Experiment;
use User;
use snmpit_lib;
use Port;
# The set of OIDs we care about
my @oids = ('ifAdminStatus','ifOperStatus');
......@@ -150,12 +151,11 @@ foreach my $name (keys %portMap) {
#
# Try to translate the port name to the node's vname
#
$port =~ /^(.+):(\d+)/;
my $nickname;
if ($1) {
my $portnum = $2;
if (defined($port->node_id())) {
my $portnum = $port->port();
my ($junk, $vname);
NodeidToExp($1,\$junk,\$junk,\$vname);
NodeidToExp($port->node_id(),\$junk,\$junk,\$vname);
$nickname = "$vname:$portnum";
}
......@@ -173,7 +173,8 @@ 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) should be $adminStatus, " .
print "Switch port for $nickname (".$port->toString().
") should be $adminStatus, " .
"but is $operStatus\n";
$errors++;
}
......
......@@ -1271,12 +1271,12 @@ sub listPorts($) {
# if port is actived, use actual rate, otherwise use desired rate
#
if ( $arate[0] eq "00" ) {
push @ports, [$finalport->getPCPort(), "no", "down", $strdrate[2], $strdrate[1]];
push @ports, [$finalport->getOtherEndPort(), "no", "down", $strdrate[2], $strdrate[1]];
} else {
#
# Not sure if it is OK to just ignore the desired rate
#
push @ports, [$finalport->getPCPort(), "yes", "up", $arate[3], $arate[2]];
push @ports, [$finalport->getOtherEndPort(), "yes", "up", $arate[3], $arate[2]];
}
}
......
......@@ -33,6 +33,7 @@ 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