From 626f682b57994dd5d6c42a77637b5cf442d1eda1 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 30 Nov 2016 16:26:58 +0100 Subject: [PATCH] + fix error undefined --- network/cisco/prime/restapi/mode/apusage.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/network/cisco/prime/restapi/mode/apusage.pm b/network/cisco/prime/restapi/mode/apusage.pm index a22a82216..d2c1cb13e 100644 --- a/network/cisco/prime/restapi/mode/apusage.pm +++ b/network/cisco/prime/restapi/mode/apusage.pm @@ -202,7 +202,9 @@ sub manage_selection { ($self->{ap}, $self->{ctrl}) = ({}, {}); - foreach my $ap_name (keys %{$access_points}) { + foreach my $ap_name (keys %{$access_points}) { + $access_points->{$ap_name}->{controllerName} = 'NotRegistered' + if (!defined($access_points->{$ap_name}->{controllerName})); if (defined($self->{option_results}->{filter_ap}) && $self->{option_results}->{filter_ap} ne '' && $ap_name !~ /$self->{option_results}->{filter_ap}/) { $self->{output}->output_add(long_msg => "skipping '" . $ap_name . "': no matching filter.", debug => 1); @@ -214,8 +216,6 @@ sub manage_selection { next; } - $access_points->{$ap_name}->{controllerName} = 'NotRegistered' - if (!defined($access_points->{$ap_name}->{controllerName})); $self->{ap}->{$ap_name} = { name => $ap_name, controller => $access_points->{$ap_name}->{controllerName}, status => $access_points->{$ap_name}->{status},