From a5139dd79b4dec93639132c41fa68a9266189ca5 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Tue, 21 Dec 2021 09:35:45 +0100 Subject: [PATCH] fix(netapp/ontap/snmp): quotas mode - change message if no quota (#3329) --- storage/netapp/ontap/snmp/mode/quotas.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/storage/netapp/ontap/snmp/mode/quotas.pm b/storage/netapp/ontap/snmp/mode/quotas.pm index 2916cbe1d..d9edb9bb0 100644 --- a/storage/netapp/ontap/snmp/mode/quotas.pm +++ b/storage/netapp/ontap/snmp/mode/quotas.pm @@ -361,6 +361,11 @@ sub manage_selection { my $multi = 1; $multi = 1024 unless defined($self->{option_results}->{not_kbytes}); + if (scalar(keys %{$self->{quotas}}) <= 0) { + $self->{output}->add_option_msg(short_msg => 'No quota found'); + $self->{output}->option_exit(); + } + $options{snmp}->load( oids => [ map($_->{oid}, values(%$mapping_datas)) ], instances => [ map($_, keys(%{$self->{quotas}})) ], @@ -380,11 +385,6 @@ sub manage_selection { } $self->{quotas}->{$instance}->{soft_limit} = $soft_limit; } - - if (scalar(keys %{$self->{quotas}}) <= 0) { - $self->{output}->add_option_msg(short_msg => "No quota found"); - $self->{output}->option_exit(); - } } 1;