Merge pull request #2415 from centreon/fix-pr-2411

fix #2411
This commit is contained in:
qgarnier 2020-12-07 16:19:04 +01:00 committed by GitHub
commit f74acb01d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -279,11 +279,15 @@ sub display_list_plugin {
output => $self->{output}, module => 'FindBin',
error_msg => "Cannot load module 'FindBin'."
);
my $directory = $FindBin::Bin;
if (defined($ENV{PAR_TEMP})) {
$directory = $ENV{PAR_TEMP} . '/inc/lib';
}
# Search file 'plugin.pm'
$self->check_directory($FindBin::Bin);
$self->check_directory($directory);
foreach my $key (sort keys %{$self->{plugins_result}}) {
my $name = $key;
$name =~ s/^$FindBin::Bin\/(.*)\.pm/$1/;
$name =~ s/^\Q$directory\E\/(.*)\.pm/$1/;
$name =~ s/\//::/g;
$self->{plugins_result}->{$key} =~ s/^Plugin Description/DESCRIPTION/i;