dont break everything when one of the vars in inject does not template correctly, wait till its used

pull/10587/head
Brian Coca 10 years ago
parent 57ed994766
commit 17e086fe8c

@ -188,7 +188,11 @@ class _jinja2_vars(object):
if isinstance(var, dict) and varname == "vars" or isinstance(var, HostVars): if isinstance(var, dict) and varname == "vars" or isinstance(var, HostVars):
return var return var
else: else:
return template(self.basedir, var, self.vars, fail_on_undefined=self.fail_on_undefined) try:
return template(self.basedir, var, self.vars, fail_on_undefined=self.fail_on_undefined)
except:
raise KeyError("undefined variable: %s" % varname)
def add_locals(self, locals): def add_locals(self, locals):
''' '''

Loading…
Cancel
Save