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

Fixes #2196.
This commit is contained in:
Daniel Hokka Zakrisson 2013-02-25 22:26:16 +01:00
parent 7e0ee6809c
commit 1df56c07d3

View file

@ -173,6 +173,8 @@ def _varFind(basedir, text, vars, lookup_fatal, depth, expand_lists):
if instance is not None:
try:
replacement = instance.run(args, inject=vars)
if expand_lists:
replacement = u",".join([unicode(x) for x in replacement])
except errors.AnsibleError:
if not lookup_fatal:
replacement = None