Commit ecebc964 authored by Robert Ricci's avatar Robert Ricci

Reverse the order of switches when removing VLANs, to prevent a race

condition between two snmpits.
parent 2f2a1390
......@@ -441,9 +441,13 @@ sub removeVlan($@) {
#
# Now, we go through each device and remove all ports from the VLAN
# on that device
# on that device. Note the reverse sort order! This way, we do not
# interfere with another snmpit processes, since createVlan tries
# in 'forward' order (we will remove the VLAN from the 'last' switch
# first, so the other snmpit will not see it free until it's been
# removed from all switches)
#
foreach my $devicename (sort {tbsort($a,$b)} keys %{$self->{DEVICES}}) {
foreach my $devicename (sort {tbsort($b,$a)} keys %{$self->{DEVICES}}) {
my $device = $self->{DEVICES}{$devicename};
my @existant_vlans = ();
my %vlan_numbers = $device->findVlans(@vlan_ids);
......
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