From 2c4b9bd8fa6d49dcff598de68425dbfe702eb711 Mon Sep 17 00:00:00 2001 From: Simon Bomm Date: Wed, 11 May 2022 15:51:24 +0200 Subject: [PATCH] (plugin) apps::pvx::restapi - fix bugs when default-value option is used --- centreon-plugins/apps/pvx/restapi/custom/api.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/apps/pvx/restapi/custom/api.pm b/centreon-plugins/apps/pvx/restapi/custom/api.pm index 1526af727..4e3a0b3bc 100644 --- a/centreon-plugins/apps/pvx/restapi/custom/api.pm +++ b/centreon-plugins/apps/pvx/restapi/custom/api.pm @@ -169,8 +169,10 @@ sub query_range { if (defined( $self->{option_results}->{default_value} ) && $options{filter} ne '' && !exists( $result->{data} )) { $options{filter} =~ /([^\s\\]+) = \"([^\s\\]+)\"/; - push @{$result->{data}->{key}}, { value => $2 }; - push @{$result->{data}->{values}}, { value => $self->{option_results}->{default_value} }; + $result->{data} = [ + { key => [ { value => $2 } ] }, + { values => [ { value => $self->{option_results}->{default_value} } ] } + ]; } return $result->{data};