fix module loading for azure custom modes

This commit is contained in:
Colin Gagnaire 2019-02-21 12:00:21 +01:00
parent 00d883ac77
commit 643950f06c
2 changed files with 8 additions and 8 deletions

View File

@ -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;

View File

@ -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;