Skip to content

Commit

Permalink
Merge pull request #13416 from terminalmage/issue13408
Browse files Browse the repository at this point in the history
Don't report incorrect line from jinja exception
  • Loading branch information
thatch45 committed Jun 12, 2014
2 parents a2750fd + 47d0762 commit 6c2acd3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions salt/utils/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,12 @@ def render_jinja_tmpl(tmplstr, context, tmplpath=None):
tmplstr)
except jinja2.exceptions.UndefinedError as exc:
trace = traceback.extract_tb(sys.exc_info()[2])
line, out = _get_jinja_error(trace, context=unicode_context)
if not line:
tmplstr = ''
out = _get_jinja_error(trace, context=unicode_context)[1]
tmplstr = ''
raise SaltRenderError(
'Jinja variable {0}{1}'.format(
exc, out),
line,
tmplstr)
buf=tmplstr)
except (SaltInvocationError, CommandExecutionError) as exc:
trace = traceback.extract_tb(sys.exc_info()[2])
line, out = _get_jinja_error(trace, context=unicode_context)
Expand Down

0 comments on commit 6c2acd3

Please sign in to comment.