From e782c71f2d74377da741a4d5da5b06e0cfb8b155 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Wed, 28 Oct 2020 14:44:01 +0100 Subject: [PATCH] fix smartermail (#2296) --- centreon-plugins/apps/smartermail/restapi/custom/api.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/apps/smartermail/restapi/custom/api.pm b/centreon-plugins/apps/smartermail/restapi/custom/api.pm index 5e04feb15..4473051c1 100644 --- a/centreon-plugins/apps/smartermail/restapi/custom/api.pm +++ b/centreon-plugins/apps/smartermail/restapi/custom/api.pm @@ -117,11 +117,11 @@ sub get_port { } sub json_decode { - my ($self, $content) = @_; + my ($self, %options) = @_; my $decoded; eval { - $decoded = JSON::XS->new->utf8->decode($content); + $decoded = JSON::XS->new->utf8->decode($options{content}); }; if ($@) { $self->{output}->add_option_msg(short_msg => "Cannot decode json response: $@"); @@ -188,7 +188,7 @@ sub get_auth_token { $self->{output}->option_exit(); } - my $decoded = $self->json_decode($content); + my $decoded = $self->json_decode(content => $content); if (!defined($decoded->{accessToken})) { $self->{output}->add_option_msg(short_msg => "Cannot get token"); $self->{output}->option_exit();