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

Fixes #2196.
pull/4420/head
Daniel Hokka Zakrisson 2013-02-25 22:26:16 +01:00
parent 7e0ee6809c
commit 1df56c07d3
1 changed files with 2 additions and 0 deletions

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