Commit 208085cc authored by Aleksander Maricq's avatar Aleksander Maricq

Fix Issue #401 - Update Mellanox snmpit module to handle non-portchannels in setVlansOnTrunk()

parent 36f4dd32
......@@ -1563,9 +1563,18 @@ sub setVlansOnTrunk($$$$) {
my ($poifindex) = $self->convertPortFormat($PORT_FORMAT_IFINDEX, $modport);
if (!exists($self->{POIFINDEX}{$poifindex})) {
warn "$id: WARNING: port $modport is not a portchannel - ".
"not adding/removing vlans.\n";
return 0;
warn "$id: WARNING: port $modport is not a portchannel.\n";
# We still want to be able to handle setVlansOnTrunk being called for
# non-portchannels. Loop over the vlans and call the proper functions.
foreach my $vlan (@vlan_numbers) {
next unless $self->vlanNumberExists($vlan);
if ($value == 1) {
$errors += $self->setPortVlan($vlan, $poifindex);
} else {
$errors += $self->removeSomePortsFromVlan($vlan, $poifindex);
}
}
return $errors ? 0 : 1;
}
$self->lock();
......
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