Commit a388cd69 by Shirou WAKAYAMA Committed by Toshio Kuratomi

use to_unicode() in _jinja2_vars if type is str.

parent c33d2fa2
...@@ -33,7 +33,7 @@ import ast ...@@ -33,7 +33,7 @@ import ast
import traceback import traceback
from ansible.utils.string_functions import count_newlines_from_end from ansible.utils.string_functions import count_newlines_from_end
from ansible.utils import to_bytes from ansible.utils import to_bytes, to_unicode
class Globals(object): class Globals(object):
...@@ -184,6 +184,8 @@ class _jinja2_vars(object): ...@@ -184,6 +184,8 @@ class _jinja2_vars(object):
var = self.vars[varname] var = self.vars[varname]
# HostVars is special, return it as-is, as is the special variable # HostVars is special, return it as-is, as is the special variable
# 'vars', which contains the vars structure # 'vars', which contains the vars structure
if type(var) == str:
var = to_unicode(var)
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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment