(plugin) network:🇦🇼:orchestrator::restapi - fix filter-hostname option (#3928)

This commit is contained in:
qgarnier 2022-09-27 11:23:41 +02:00 committed by GitHub
parent f47b2b0415
commit 605c8e91e5
2 changed files with 7 additions and 2 deletions

View File

@ -120,11 +120,16 @@ sub manage_selection {
foreach my $appliance (@$appliances) {
next if (defined($self->{option_results}->{filter_hostname}) && $self->{option_results}->{filter_hostname} ne '' &&
$appliance->{hostname} !~ /$self->{option_results}->{filter_hostname}/);
$appliance->{hostName} !~ /$self->{option_results}->{filter_hostname}/);
push @{$post->{ids}}, $appliance->{id};
}
if (scalar(@{$post->{ids}}) <= 0) {
$self->{output}->add_option_msg(short_msg => 'no appliances selected');
$self->{output}->option_exit();
}
my $results = $options{custom}->request_api(
method => 'POST',
endpoint => '/alarm/appliance',

View File

@ -128,7 +128,7 @@ sub manage_selection {
$self->{appliances} = {};
foreach my $appliance (@$appliances) {
next if (defined($self->{option_results}->{filter_hostname}) && $self->{option_results}->{filter_hostname} ne '' &&
$appliance->{hostname} !~ /$self->{option_results}->{filter_hostname}/);
$appliance->{hostName} !~ /$self->{option_results}->{filter_hostname}/);
my $group = $self->get_group(groups => $groups, groupId => $appliance->{groupId});
next if (defined($self->{option_results}->{filter_group}) && $self->{option_results}->{filter_group} ne '' &&