fixed listify for lookups, made sure convert_bare is only on with_

This commit is contained in:
Brian Coca 2015-08-11 16:38:42 -04:00
commit 6e825e8c22
3 changed files with 6 additions and 8 deletions

View file

@ -26,14 +26,12 @@ from ansible.template.safe_eval import safe_eval
__all__ = ['listify_lookup_plugin_terms']
#FIXME: probably just move this into lookup plugin base class
def listify_lookup_plugin_terms(terms, templar, loader, fail_on_undefined=False):
def listify_lookup_plugin_terms(terms, templar, loader, fail_on_undefined=False, convert_bare=False):
if isinstance(terms, basestring):
stripped = terms.strip()
#FIXME: warn/deprecation on bare vars in with_ so we can eventually remove fail on undefined override
terms = templar.template(terms, convert_bare=True, fail_on_undefined=fail_on_undefined)
#TODO: check if this is needed as template should also return correct type already
#terms = safe_eval(terms)
terms = templar.template(terms, convert_bare=convert_bare, fail_on_undefined=fail_on_undefined)
else:
terms = templar.template(terms, fail_on_undefined=fail_on_undefined)