From 0df621c8120c2319eaef5aaf154656451d9e1376 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Fri, 23 Apr 2021 09:09:14 +0200 Subject: [PATCH] fix(aws/health): events mode - filter issue with paws custommode (#2731) --- cloud/aws/custom/paws.pm | 4 ++-- cloud/aws/health/mode/events.pm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cloud/aws/custom/paws.pm b/cloud/aws/custom/paws.pm index b971dffa9..59513974d 100644 --- a/cloud/aws/custom/paws.pm +++ b/cloud/aws/custom/paws.pm @@ -582,8 +582,8 @@ sub health_describe_events { my $health = Paws->service('Health', caller => $lwp_caller, region => $self->{option_results}->{region}); my $health_options = { Filter => {} }; foreach ((['service', 'Services'], ['region', 'Regions'], ['entity_value', 'EntityValues'], ['event_status', 'EventStatusCodes'], ['event_category', 'EventTypeCategories'])) { - next if (!defined($options{ $_->[0] })); - $health_options->{Filter}->{ $_->[1] } = $_->[0]; + next if (!defined($options{ 'filter_' . $_->[0] })); + $health_options->{Filter}->{ $_->[1] } = $options{ 'filter_' . $_->[0] }; } while ((my $events = $health->DescribeEvents(%$health_options))) { diff --git a/cloud/aws/health/mode/events.pm b/cloud/aws/health/mode/events.pm index 16e8c306f..55d29d0e8 100644 --- a/cloud/aws/health/mode/events.pm +++ b/cloud/aws/health/mode/events.pm @@ -103,7 +103,7 @@ sub check_options { next if ($option eq ''); $self->{filter_options}->{'filter_' . $_} = [] if (!defined($self->{filter_options}->{'filter_' . $_})); - push @{$self->{filter_options}->{'filter_' . $_}}, $option; + push @{$self->{filter_options}->{'filter_' . $_}}, split(/,/, $options); } } }