From f0f5a9a60c28c29e11cdc484682c90ad6c10eaec Mon Sep 17 00:00:00 2001 From: Colin Gagnaire Date: Thu, 21 Feb 2019 12:00:21 +0100 Subject: [PATCH] fix module loading for azure custom modes --- cloud/azure/custom/api.pm | 8 ++++---- cloud/azure/custom/azcli.pm | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cloud/azure/custom/api.pm b/cloud/azure/custom/api.pm index 1de936339..aa794fb6a 100644 --- a/cloud/azure/custom/api.pm +++ b/cloud/azure/custom/api.pm @@ -246,15 +246,15 @@ sub convert_duration { my $duration; if ($options{time_string} =~ /^P.*S$/) { - centreon::plugins::misc::mymodule_load(module => 'DateTime::Format::Duration::ISO8601', - error_msg => "Cannot load module 'DateTime::Format::Duration::ISO8601'."); + centreon::plugins::misc::mymodule_load(output => $self->{output}, module => 'DateTime::Format::Duration::ISO8601', + error_msg => "Cannot load module 'DateTime::Format::Duration::ISO8601'."); my $format = DateTime::Format::Duration::ISO8601->new; my $d = $format->parse_duration($options{time_string}); $duration = $d->minutes * 60 + $d->seconds; } elsif ($options{time_string} =~ /^(\d+):(\d+):(\d+)\.\d+$/) { - centreon::plugins::misc::mymodule_load(module => 'DateTime::Duration', - error_msg => "Cannot load module 'DateTime::Format::Duration'."); + centreon::plugins::misc::mymodule_load(output => $self->{output}, module => 'DateTime::Duration', + error_msg => "Cannot load module 'DateTime::Format::Duration'."); my $d = DateTime::Duration->new(hours => $1, minutes => $2, seconds => $3); $duration = $d->minutes * 60 + $d->seconds; diff --git a/cloud/azure/custom/azcli.pm b/cloud/azure/custom/azcli.pm index 4bd4f70ff..0b2ee85a7 100644 --- a/cloud/azure/custom/azcli.pm +++ b/cloud/azure/custom/azcli.pm @@ -141,15 +141,15 @@ sub convert_duration { my $duration; if ($options{time_string} =~ /^P.*S$/) { - centreon::plugins::misc::mymodule_load(module => 'DateTime::Format::Duration::ISO8601', - error_msg => "Cannot load module 'DateTime::Format::Duration::ISO8601'."); + centreon::plugins::misc::mymodule_load(output => $self->{output}, module => 'DateTime::Format::Duration::ISO8601', + error_msg => "Cannot load module 'DateTime::Format::Duration::ISO8601'."); my $format = DateTime::Format::Duration::ISO8601->new; my $d = $format->parse_duration($options{time_string}); $duration = $d->minutes * 60 + $d->seconds; } elsif ($options{time_string} =~ /^(\d+):(\d+):(\d+)\.\d+$/) { - centreon::plugins::misc::mymodule_load(module => 'DateTime::Duration', - error_msg => "Cannot load module 'DateTime::Format::Duration'."); + centreon::plugins::misc::mymodule_load(output => $self->{output}, module => 'DateTime::Duration', + error_msg => "Cannot load module 'DateTime::Format::Duration'."); my $d = DateTime::Duration->new(hours => $1, minutes => $2, seconds => $3); $duration = $d->minutes * 60 + $d->seconds;