Commit 66e5515f by Toshio Kuratomi Committed by James Cammarata

Fix for unicode filenames for template module

Fixes #10110
parent 6b315d57
...@@ -33,6 +33,7 @@ import ast ...@@ -33,6 +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
class Globals(object): class Globals(object):
...@@ -272,7 +273,7 @@ def template_from_file(basedir, path, vars, vault_password=None): ...@@ -272,7 +273,7 @@ def template_from_file(basedir, path, vars, vault_password=None):
managed_str = managed_default.format( managed_str = managed_default.format(
host = vars['template_host'], host = vars['template_host'],
uid = vars['template_uid'], uid = vars['template_uid'],
file = vars['template_path'] file = to_bytes(vars['template_path'])
) )
vars['ansible_managed'] = time.strftime( vars['ansible_managed'] = time.strftime(
managed_str, managed_str,
......
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