tidy up reindex call
This commit is contained in:
1
Changes
1
Changes
@@ -3,6 +3,7 @@
|
|||||||
[ENHANCEMENTS]
|
[ENHANCEMENTS]
|
||||||
|
|
||||||
* #363 Show user fullname if available in navbar (earendilfr)
|
* #363 Show user fullname if available in navbar (earendilfr)
|
||||||
|
* #366 Retrieve VRF interface IPs (earendilfr)
|
||||||
|
|
||||||
2.038031 - 2018-01-23
|
2.038031 - 2018-01-23
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ register_worker({ phase => 'early', driver => 'snmp' }, sub {
|
|||||||
my @vrf_list = _get_vrf_list($device, $snmp);
|
my @vrf_list = _get_vrf_list($device, $snmp);
|
||||||
|
|
||||||
{
|
{
|
||||||
my $guard = guard { snmp_comm_reindex($snmp, $device, 0, 0) };
|
my $guard = guard { snmp_comm_reindex($snmp, $device, 0) };
|
||||||
foreach my $vrf (@vrf_list) {
|
foreach my $vrf (@vrf_list) {
|
||||||
snmp_comm_reindex($snmp, $device, $vrf, 0);
|
snmp_comm_reindex($snmp, $device, $vrf);
|
||||||
$ip_index = { %$ip_index , %{$snmp->ip_index} };
|
$ip_index = { %$ip_index , %{$snmp->ip_index} };
|
||||||
$interfaces = { %$interfaces , %{$snmp->interfaces} };
|
$interfaces = { %$interfaces , %{$snmp->interfaces} };
|
||||||
$ip_netmask = { %$ip_netmask , %{$snmp->ip_netmask} };
|
$ip_netmask = { %$ip_netmask , %{$snmp->ip_netmask} };
|
||||||
@@ -261,7 +261,7 @@ register_worker({ phase => 'early', driver => 'snmp' }, sub {
|
|||||||
sub _get_vrf_list {
|
sub _get_vrf_list {
|
||||||
my ($device, $snmp) = @_;
|
my ($device, $snmp) = @_;
|
||||||
|
|
||||||
return () if !$snmp->cisco_comm_indexing;
|
return () if ! $snmp->cisco_comm_indexing;
|
||||||
|
|
||||||
my @ok_vrfs = ();
|
my @ok_vrfs = ();
|
||||||
my $vrf_name = $snmp->vrf_name || {};
|
my $vrf_name = $snmp->vrf_name || {};
|
||||||
@@ -271,12 +271,11 @@ sub _get_vrf_list {
|
|||||||
my $ctx_name = pack("C*",split(/\./,$idx));
|
my $ctx_name = pack("C*",split(/\./,$idx));
|
||||||
$ctx_name =~ s/.*[^[:print:]]+//;
|
$ctx_name =~ s/.*[^[:print:]]+//;
|
||||||
debug sprintf(' [%s] Discover VRF %s with SNMP Context %s', $device->ip, $vrf, $ctx_name);
|
debug sprintf(' [%s] Discover VRF %s with SNMP Context %s', $device->ip, $vrf, $ctx_name);
|
||||||
push (@ok_vrfs,$ctx_name);
|
push (@ok_vrfs, $ctx_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return @ok_vrfs;
|
return @ok_vrfs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
true;
|
true;
|
||||||
|
|||||||
Reference in New Issue
Block a user