Commit af616fe1 by Richard C Isaacson

Rename flatten funciton.

flatten(x) is used a lot in the various lookup plugins where in each it is slightly different. This is to make this name slightly more unique.
parent 0cca4a39
...@@ -19,7 +19,7 @@ from ansible.utils import safe_eval ...@@ -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): ...@@ -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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment