discovery mode fix (#2315)

This commit is contained in:
itoussies 2020-11-02 14:34:38 +01:00 committed by GitHub
parent 518992a880
commit 440cda07bd
1 changed files with 11 additions and 6 deletions

View File

@ -20,11 +20,10 @@
package apps::monitoring::alyvix::restapi::mode::listtestcases; package apps::monitoring::alyvix::restapi::mode::listtestcases;
use base qw(centreon::plugins::templates::counter); use base qw(centreon::plugins::mode);
use strict; use strict;
use warnings; use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold);
sub new { sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
@ -38,6 +37,11 @@ sub new {
return $self; return $self;
} }
sub check_options {
my ($self, %options) = @_;
$self->SUPER::init(%options);
}
sub manage_selection { sub manage_selection {
my ($self, %options) = @_; my ($self, %options) = @_;
@ -81,10 +85,11 @@ sub disco_show {
my $testcases = $self->manage_selection(%options); my $testcases = $self->manage_selection(%options);
foreach my $testcase (@$testcases) { foreach my $testcase (@$testcases) {
next if (defined($self->{option_results}->{filter_case}) next if (defined($self->{option_results}->{filter_testcase})
&& $self->{option_results}->{filter_case} ne '' && $self->{option_results}->{filter_testcase} ne ''
&& $testcase->{scenario} !~ /$self->{option_results}->{filter_case}/ ); && $testcase->{testcase_alias} !~ /$self->{option_results}->{filter_testcase}/ );
$self->{output}->add_disco_entry(name => $testcases->{testcase_alias});
$self->{output}->add_disco_entry(name => $testcase->{testcase_alias});
} }
} }