Allow jinja2 evals that produce lists to be used in with_items. Ideally want something a bit less heavy

than the eval here.
This commit is contained in:
Michael DeHaan 2013-04-10 15:22:08 -04:00
parent e8085ad40c
commit fecfbf9226
2 changed files with 23 additions and 4 deletions

View file

@ -31,5 +31,11 @@ class LookupModule(object):
def run(self, terms, **kwargs):
if isinstance(terms, basestring):
if '{' or '[' in terms:
# Jinja2-ified list needs to be converted back to a real type
# TODO: something a bit less heavy than eval
terms = eval(terms)
terms = [ terms ]
return flatten(terms)