From 31c750691949b2271324eef187928680a2ee3888 Mon Sep 17 00:00:00 2001 From: Brant Evans Date: Tue, 1 Aug 2023 06:44:37 -0700 Subject: [PATCH] Default filters to empty dictionary (#1670) Default filters to empty dictionary SUMMARY Changes the default for the filters option from None to an empty dictionary. Fixes: #1668 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_vpc_route_table_info ADDITIONAL INFORMATION This matches what other *info modules (e.g. ec2_vpc_endpoint_info or ec2_vpc_subnet_info) do for the filters option default. Reviewed-by: Alina Buzachis Reviewed-by: Brant Evans Reviewed-by: Mark Chappell Reviewed-by: Mike Graves --- changelogs/fragments/ec2_vpc_route_table_info-filter-fix.yml | 2 ++ plugins/modules/ec2_vpc_route_table_info.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/ec2_vpc_route_table_info-filter-fix.yml diff --git a/changelogs/fragments/ec2_vpc_route_table_info-filter-fix.yml b/changelogs/fragments/ec2_vpc_route_table_info-filter-fix.yml new file mode 100644 index 00000000000..9b3d315dcca --- /dev/null +++ b/changelogs/fragments/ec2_vpc_route_table_info-filter-fix.yml @@ -0,0 +1,2 @@ +bugfixes: + - ec2_vpc_route_table_info - default filters to empty dictionary (https://github.com/ansible-collections/amazon.aws/issues/1668). diff --git a/plugins/modules/ec2_vpc_route_table_info.py b/plugins/modules/ec2_vpc_route_table_info.py index 0e5bfb329c7..21c9fc6674a 100644 --- a/plugins/modules/ec2_vpc_route_table_info.py +++ b/plugins/modules/ec2_vpc_route_table_info.py @@ -20,6 +20,7 @@ - A dict of filters to apply. Each dict item consists of a filter key and a filter value. See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeRouteTables.html) for possible filters. type: dict + default: {} extends_documentation_fragment: - amazon.aws.common.modules - amazon.aws.region.modules @@ -260,7 +261,7 @@ def list_ec2_vpc_route_tables(connection, module): def main(): argument_spec = dict( - filters=dict(default=None, type="dict"), + filters=dict(default={}, type="dict"), ) module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True)