From 2d73892acfd1a895854fef37eaf798beeeefcdbb Mon Sep 17 00:00:00 2001 From: Shirou WAKAYAMA Date: Wed, 11 Mar 2015 14:50:27 +0900 Subject: [PATCH] use to_unicode() in _jinja2_vars if type is str. --- lib/ansible/utils/template.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/utils/template.py b/lib/ansible/utils/template.py index 722e33e4c8f..919436895a9 100644 --- a/lib/ansible/utils/template.py +++ b/lib/ansible/utils/template.py @@ -33,7 +33,7 @@ import ast import traceback 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): @@ -184,6 +184,8 @@ class _jinja2_vars(object): var = self.vars[varname] # HostVars is special, return it as-is, as is the special variable # '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): return var else: