If expand_lists is true, make lookup plugin result into a string

Fixes #2196.
parent 7e0ee680
...@@ -173,6 +173,8 @@ def _varFind(basedir, text, vars, lookup_fatal, depth, expand_lists): ...@@ -173,6 +173,8 @@ def _varFind(basedir, text, vars, lookup_fatal, depth, expand_lists):
if instance is not None: if instance is not None:
try: try:
replacement = instance.run(args, inject=vars) replacement = instance.run(args, inject=vars)
if expand_lists:
replacement = u",".join([unicode(x) for x in replacement])
except errors.AnsibleError: except errors.AnsibleError:
if not lookup_fatal: if not lookup_fatal:
replacement = None replacement = None
......
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