mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #6166 from risaacson/rename_flatten_in_dict
Rename flatten function.
This commit is contained in:
commit
ca78657538
1 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@ from ansible.utils import safe_eval
|
||||||
import ansible.utils as utils
|
import ansible.utils as utils
|
||||||
import ansible.errors as errors
|
import ansible.errors as errors
|
||||||
|
|
||||||
def flatten(terms):
|
def flatten_hash_to_list(terms):
|
||||||
ret = []
|
ret = []
|
||||||
for key in terms:
|
for key in terms:
|
||||||
ret.append({'key': key, 'value': terms[key]})
|
ret.append({'key': key, 'value': terms[key]})
|
||||||
|
@ -36,4 +36,4 @@ class LookupModule(object):
|
||||||
if not isinstance(terms, dict):
|
if not isinstance(terms, dict):
|
||||||
raise errors.AnsibleError("with_dict expects a dict")
|
raise errors.AnsibleError("with_dict expects a dict")
|
||||||
|
|
||||||
return flatten(terms)
|
return flatten_hash_to_list(terms)
|
||||||
|
|
Loading…
Reference in a new issue