Revert "Make listify respect the global setting for undefined variables."

This 'mostly' reverts commit 2769098fe7.

Conflicts:
	lib/ansible/utils/__init__.py
	test/units/TestUtils.py
This commit is contained in:
Brian Coca
2014-12-04 09:14:53 -05:00
parent e938f554b7
commit 97408fe5b2
2 changed files with 3 additions and 16 deletions

View File

@@ -48,7 +48,6 @@ import sys
import json
import subprocess
import contextlib
import jinja2.exceptions
from vault import VaultLib
@@ -1469,15 +1468,11 @@ 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, terms, inject, convert_bare=True, fail_on_undefined=C.DEFAULT_UNDEFINED_VAR_BEHAVIOR)
new_terms = template.template(basedir, "{{ %s }}" % terms, inject)
if isinstance(new_terms, basestring) and "{{" in new_terms:
pass
else:
terms = new_terms
except errors.AnsibleUndefinedVariable:
raise
except jinja2.exceptions.UndefinedError, e:
raise errors.AnsibleUndefinedVariable('undefined variable in items: %s' % e)
except:
pass