mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Fix dangerous default args. (#29839)
This commit is contained in:
@@ -395,7 +395,7 @@ def _validate_named_port_params(params):
|
||||
return (True, '')
|
||||
|
||||
|
||||
def _get_instance_list(mig, field='name', filter_list=['NONE']):
|
||||
def _get_instance_list(mig, field='name', filter_list=None):
|
||||
"""
|
||||
Helper to grab field from instances response.
|
||||
|
||||
@@ -414,6 +414,8 @@ def _get_instance_list(mig, field='name', filter_list=['NONE']):
|
||||
:return: List of strings from list_managed_instances response.
|
||||
:rtype: ``list``
|
||||
"""
|
||||
filter_list = ['NONE'] if filter_list is None else filter_list
|
||||
|
||||
return [x[field] for x in mig.list_managed_instances()
|
||||
if x['currentAction'] in filter_list]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user