mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-09 01:39:10 -07:00
Fix dangerous default args. (#29839)
This commit is contained in:
parent
5caa47feb9
commit
68aeaa58a8
50 changed files with 253 additions and 87 deletions
|
@ -67,7 +67,7 @@ def transform_list_to_dict(list_):
|
|||
return ret
|
||||
|
||||
|
||||
def merge_list_by_key(original_list, updated_list, key, ignore_when_null=[]):
|
||||
def merge_list_by_key(original_list, updated_list, key, ignore_when_null=None):
|
||||
"""
|
||||
Merge two lists by the key. It basically:
|
||||
|
||||
|
@ -84,6 +84,8 @@ def merge_list_by_key(original_list, updated_list, key, ignore_when_null=[]):
|
|||
if its values are null.
|
||||
:return: list: Lists merged.
|
||||
"""
|
||||
ignore_when_null = [] if ignore_when_null is None else ignore_when_null
|
||||
|
||||
if not original_list:
|
||||
return updated_list
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue