Skip to content

Commit

Permalink
now only flattened ignores failonundefined cause of it's special need
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoca committed Nov 25, 2014
1 parent e3feb10 commit db145a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/ansible/runner/lookup_plugins/flattened.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def flatten(self, terms, inject):

if isinstance(term, basestring):
# convert a variable to a list
term2 = utils.listify_lookup_plugin_terms(term, self.basedir, inject)
term2 = utils.listify_lookup_plugin_terms(term, self.basedir, inject, fail_on_undefined=False)
# but avoid converting a plain string to a list of one string
if term2 != [ term ]:
term = term2
Expand Down
4 changes: 2 additions & 2 deletions lib/ansible/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,7 @@ def generic_visit(self, node, inside_call=False):
return expr


def listify_lookup_plugin_terms(terms, basedir, inject):
def listify_lookup_plugin_terms(terms, basedir, inject, fail_on_undefined=C.DEFAULT_UNDEFINED_VAR_BEHAVIOR):

from ansible.utils import template

Expand All @@ -1469,7 +1469,7 @@ def listify_lookup_plugin_terms(terms, basedir, inject):
# if not already a list, get ready to evaluate with Jinja2
# not sure why the "/" is in above code :)
try:
new_terms = template.template(basedir, "{{%s}}" % terms, inject, convert_bare=True)
new_terms = template.template(basedir, "{{%s}}" % terms, inject, convert_bare=True, fail_on_undefined=fail_on_undefined)
if isinstance(new_terms, basestring) and "{{" in new_terms:
pass
else:
Expand Down

0 comments on commit db145a3

Please sign in to comment.