Skip to content

Commit

Permalink
scrub_none_parameters - set default for descend_into_lists to True (b…
Browse files Browse the repository at this point in the history
…reaking change) (ansible-collections#297)

scrub_none_parameters - set default for descend_into_lists to True (breaking change)

Reviewed-by: https://github.com/apps/ansible-zuul
  • Loading branch information
tremble authored May 19, 2021
1 parent 9c42b6c commit 76b04f8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
breaking_changes:
- module_utils/core - updated the ``scrub_none_parameters`` function so that ``descend_into_lists`` is set to ``True`` by default (https://github.com/ansible-collections/amazon.aws/pull/297).
2 changes: 1 addition & 1 deletion plugins/module_utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def get_boto3_client_method_parameters(client, method_name, required=False):
return parameters


def scrub_none_parameters(parameters, descend_into_lists=False):
def scrub_none_parameters(parameters, descend_into_lists=True):
"""
Iterate over a dictionary removing any keys that have a None value
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/module_utils/core/test_scrub_none_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@

@pytest.mark.parametrize("input_params, output_params_no_descend, output_params_descend", scrub_none_test_data)
def test_scrub_none_parameters(input_params, output_params_no_descend, output_params_descend):
assert scrub_none_parameters(input_params) == output_params_no_descend
assert scrub_none_parameters(input_params) == output_params_descend
assert scrub_none_parameters(input_params, descend_into_lists=False) == output_params_no_descend
assert scrub_none_parameters(input_params, descend_into_lists=True) == output_params_descend

0 comments on commit 76b04f8

Please sign in to comment.