Skip to content

Commit

Permalink
Default filters to empty dictionary (ansible-collections#1670)
Browse files Browse the repository at this point in the history
Default filters to empty dictionary

SUMMARY

Changes the default for the filters option from None to an empty dictionary.

Fixes: ansible-collections#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 <[email protected]>
Reviewed-by: Mark Chappell
Reviewed-by: Mike Graves <[email protected]>
  • Loading branch information
branic authored Aug 1, 2023
1 parent faaad0e commit 31c7506
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/ec2_vpc_route_table_info-filter-fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- ec2_vpc_route_table_info - default filters to empty dictionary (https://github.com/ansible-collections/amazon.aws/issues/1668).
3 changes: 2 additions & 1 deletion plugins/modules/ec2_vpc_route_table_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 31c7506

Please sign in to comment.