fix bug in vlan filtered netmap, duplicate nodes

This commit is contained in:
Oliver Gorwits
2020-01-22 21:19:04 +00:00
parent abf415a1ca
commit ee86e62ac7
2 changed files with 12 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
2.044006 - 2019-01-22
[BUG FIXES]
* #677 neighbors map with VLAN filter should only consider configured ports
2.044005 - 2019-01-19 2.044005 - 2019-01-19
[ENHANCEMENTS] [ENHANCEMENTS]
@@ -13,8 +19,8 @@
* #81 (redux) avoid DEPRECATED warning from DBIC * #81 (redux) avoid DEPRECATED warning from DBIC
* #524 ipinventory misses mac address for device ips * #524 ipinventory misses mac address for device ips
* #667 neighbors map with VLAN filter should only consider configured ports
* #676 remove vim settings from files * #676 remove vim settings from files
* #677 neighbors map with VLAN filter should only consider configured ports
* #679 uninitialised error * #679 uninitialised error
* #686 makerancidconf excluded setting should be (ACL) list not dict * #686 makerancidconf excluded setting should be (ACL) list not dict

View File

@@ -216,7 +216,10 @@ ajax '/ajax/data/device/netmap' => require_login sub {
); );
} }
my %seen_node = ();
DEVICE: while (my $device = $devices->next) { DEVICE: while (my $device = $devices->next) {
next if $seen_node{$device->ip};
# if in neighbors mode then use %ok_dev to filter # if in neighbors mode then use %ok_dev to filter
next DEVICE if ($device->ip ne $qdev->ip) next DEVICE if ($device->ip ne $qdev->ip)
and ($mapshow eq 'neighbors') and ($mapshow eq 'neighbors')
@@ -269,6 +272,8 @@ ajax '/ajax/data/device/netmap' => require_login sub {
} }
push @{$data{'nodes'}}, $node; push @{$data{'nodes'}}, $node;
++$seen_node{$device->ip};
$metadata{'centernode'} = $device->ip $metadata{'centernode'} = $device->ip
if $qdev and $qdev->in_storage and $device->ip eq $qdev->ip; if $qdev and $qdev->in_storage and $device->ip eq $qdev->ip;
} }