mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #12575 from hulu/unicode_jinja
Fix unicode conditional in jinja template fixes #12564
This commit is contained in:
commit
776280a034
@ -258,7 +258,10 @@ def render_jinja_tmpl(tmplstr, context, tmplpath=None):
|
||||
|
||||
# Let's try UTF-8 and fail if this still fails, that's why this is not
|
||||
# wrapped in a try/except
|
||||
unicode_context[key] = unicode(value, 'utf-8')
|
||||
if isinstance(value, unicode):
|
||||
unicode_context[key] = value
|
||||
else:
|
||||
unicode_context[key] = unicode(value, 'utf-8')
|
||||
|
||||
try:
|
||||
template = jinja_env.from_string(tmplstr)
|
||||
|
Loading…
Reference in New Issue
Block a user