From dd4787701f45536ac37fe81d46ba0846caf35411 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 29 Jan 2016 10:41:57 -0500 Subject: [PATCH] fix unicode input for template lookup fixes #14207 --- lib/ansible/plugins/lookup/template.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/lookup/template.py b/lib/ansible/plugins/lookup/template.py index 2ca2e5673b..3f452a1198 100644 --- a/lib/ansible/plugins/lookup/template.py +++ b/lib/ansible/plugins/lookup/template.py @@ -22,6 +22,7 @@ import os from ansible import constants as C from ansible.errors import AnsibleError from ansible.plugins.lookup import LookupBase +from ansible.utils.unicode import to_unicode try: from __main__ import display @@ -46,7 +47,7 @@ class LookupModule(LookupBase): display.vvvv("File lookup using %s as file" % lookupfile) if lookupfile and os.path.exists(lookupfile): with open(lookupfile, 'r') as f: - template_data = f.read() + template_data = to_unicode(f.read()) searchpath = [self._loader._basedir, os.path.dirname(lookupfile)] if 'role_path' in variables: