Skip to content

Commit

Permalink
enh(debug+tests): enhanced skipping explanations + added new test
Browse files Browse the repository at this point in the history
  • Loading branch information
omercier committed Sep 3, 2024
1 parent eb1daa4 commit 61c51b5
Show file tree
Hide file tree
Showing 4 changed files with 791 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,17 +218,20 @@ sub manage_selection {
foreach my $node (@$decoded) {
if (defined($self->{option_results}->{filter_vm}) && $self->{option_results}->{filter_vm} ne '' &&
$node->{name} !~ /$self->{option_results}->{filter_vm}/i) {
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter.", debug => 1);
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter vm.", debug => 1);
next;
}
if (defined($self->{option_results}->{filter_status}) && $self->{option_results}->{filter_status} ne '' &&
$node_vm_state->{ $node->{state} } !~ /$self->{option_results}->{filter_status}/i) {
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter.", debug => 1);
$self->{output}->output_add(long_msg => "skipping '" . $node->{name}
. "': node state " . $node->{state} . " (" . $node_vm_state->{ $node->{state} }
. ") does not match filter /" . $self->{option_results}->{filter_status}
. "/i", debug => 1);
next;
}
if (defined($self->{option_results}->{filter_note}) && $self->{option_results}->{filter_note} ne '' &&
defined($node->{note}) && $node->{note} !~ /$self->{option_results}->{filter_note}/i) {
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter.", debug => 1);
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter note.", debug => 1);
next;
}

Expand Down
Loading

0 comments on commit 61c51b5

Please sign in to comment.