Commit d3fa306b authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Apply changes from snmpit.in that were not applied to snmpit_new.in.

Hope I got it right.
parent 02f0682f
......@@ -19,6 +19,7 @@ my $ELABINELAB = @ELABINELAB@;
my $NOSTACKMIB = @NOSTACKMIB@;
my $MAINSITE = @TBMAINSITE@;
my $TB = '@prefix@';
my $SWITCH_NODE_STACK = "Switch-Node";
use libdb;
use User;
......@@ -666,6 +667,8 @@ if ($TESTMODE) {
}
my $exitval = 0;
my @pathlinksbyl1 = ();
COMMAND: foreach my $command (@commands) {
#
......@@ -760,6 +763,18 @@ COMMAND: foreach my $command (@commands) {
next COMMAND;
}
} else {
for (my $idx = 0; $idx < scalar(@vlans); $idx++)
{
my %ifaces = ();
if (getPathVlanIfaces($vlans[$idx], \%ifaces) != -1) {
map { print "$_=>$ifaces{$_} " } keys %ifaces;
push @pathlinksbyl1, $vlans[$idx];
print "path: $vlans[$idx] \n";
}
}
@vlans = arraySub(\@vlans, \@pathlinksbyl1);
@devicenames = mapVlansToSwitches(@vlans);
debug("Tables: list from database: " . join(",",@devicenames) .
"\n");
......@@ -1691,8 +1706,10 @@ sub doVlansFromTables($$@) {
my $vlan_number;
if (@$stacks > 1) {
die "VLAN creation across multiple stacks is not yet supported\n" .
"Stacks are " . join(", ",map {$_->{STACKID}} @$stacks) . "\n";
if (!(@$stacks == 2 && @pathlinksbyl1 > 0)) {
die "VLAN creation across multiple stacks is not yet supported\n" .
"Stacks are " . join(", ",map {$_->{STACKID}} @$stacks) . "\n";
}
}
#
......@@ -1844,6 +1861,17 @@ sub doVlansFromTables($$@) {
$vlan->Refresh();
}
}
foreach my $vlanid (@pathlinksbyl1) {
my @ports = ();
my %ifaces = ();
if (getPathVlanIfaces($vlanid, \%ifaces) != -1) {
my @ifs = keys %ifaces;
@ports = map { ifacemodport{$_} } @ifs;
$errors += CreateOneVlan($stacks, $vlanid, @ports);
}
}
return $errors;
}
......@@ -1892,7 +1920,7 @@ sub CreateOneVlan($$$@)
# Set the speed and duplex of each interface depending on the
# value in the database
#
if (!$NOSTACKMIB) {
if ((!$NOSTACKMIB) && !($stack->{STACKID} eq $SWITCH_NODE_STACK)) {
foreach my $port (@ports) {
my ($speed,$duplex) = getInterfaceSettings($port);
#
......
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