From a6b196080755a88139ae38e6fd08feca0244f58c Mon Sep 17 00:00:00 2001 From: Colin GAGNAIRE Date: Thu, 1 Mar 2018 14:25:35 +0100 Subject: [PATCH] fix hashes deref --- apps/redis/restapi/mode/clusterstats.pm | 2 +- apps/redis/restapi/mode/databasesstats.pm | 2 +- apps/redis/restapi/mode/nodesstats.pm | 2 +- apps/redis/restapi/mode/shardsstats.pm | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/redis/restapi/mode/clusterstats.pm b/apps/redis/restapi/mode/clusterstats.pm index 0699c85a8..d62facc6b 100644 --- a/apps/redis/restapi/mode/clusterstats.pm +++ b/apps/redis/restapi/mode/clusterstats.pm @@ -251,7 +251,7 @@ sub manage_selection { my $persistent_storage_size = 0; my $ephemeral_storage_size = 0; my $bigstore_size = 0; - foreach my $node (keys $result3) { + foreach my $node (keys %{$result3}) { if (defined($result3->{$node}->{total_memory})) { $total_memory = $total_memory + $result3->{$node}->{total_memory}; } diff --git a/apps/redis/restapi/mode/databasesstats.pm b/apps/redis/restapi/mode/databasesstats.pm index 0ac53b24a..9c72ecbc2 100644 --- a/apps/redis/restapi/mode/databasesstats.pm +++ b/apps/redis/restapi/mode/databasesstats.pm @@ -476,7 +476,7 @@ sub manage_selection { my $result = $options{custom}->get(path => '/v1/bdbs/stats/last?interval='.$options{custom}->get_interval()); my $result2 = $options{custom}->get(path => '/v1/bdbs'); - foreach my $database (keys $result) { + foreach my $database (keys %{$result}) { if (defined($self->{option_results}->{filter_database}) && $self->{option_results}->{filter_database} ne '' && $database !~ /$self->{option_results}->{filter_database}/) { $self->{output}->output_add(long_msg => "skipping database '" . $database . "': no matching filter.", debug => 1); diff --git a/apps/redis/restapi/mode/nodesstats.pm b/apps/redis/restapi/mode/nodesstats.pm index 95bf41e78..9458b9c92 100644 --- a/apps/redis/restapi/mode/nodesstats.pm +++ b/apps/redis/restapi/mode/nodesstats.pm @@ -333,7 +333,7 @@ sub manage_selection { my $result = $options{custom}->get(path => '/v1/nodes/stats/last?interval='.$options{custom}->get_interval()); my $result2 = $options{custom}->get(path => '/v1/nodes'); - foreach my $node (keys $result) { + foreach my $node (keys %{$result}) { if (defined($self->{option_results}->{filter_node}) && $self->{option_results}->{filter_node} ne '' && $node !~ /$self->{option_results}->{filter_node}/) { $self->{output}->output_add(long_msg => "skipping node '" . $node . "': no matching filter.", debug => 1); diff --git a/apps/redis/restapi/mode/shardsstats.pm b/apps/redis/restapi/mode/shardsstats.pm index 00e6a139c..5b3968bc3 100644 --- a/apps/redis/restapi/mode/shardsstats.pm +++ b/apps/redis/restapi/mode/shardsstats.pm @@ -357,7 +357,7 @@ sub manage_selection { my $result = $options{custom}->get(path => '/v1/shards/stats/last?interval='.$options{custom}->get_interval()); my $result2 = $options{custom}->get(path => '/v1/shards'); - foreach my $shard (keys $result) { + foreach my $shard (keys %{$result}) { if (defined($self->{option_results}->{filter_shard}) && $self->{option_results}->{filter_shard} ne '' && $shard !~ /$self->{option_results}->{filter_shard}/) { $self->{output}->output_add(long_msg => "skipping shard '" . $shard . "': no matching filter.", debug => 1);