Commit 2aef0335 by Grzegorz Nosek Committed by Michael DeHaan

Handle UTF-8 in templates

This is required to run commands containing non-ASCII characters, e.g.:

ansible localhost -m shell -a 'echo ą'
parent 41211096
......@@ -215,6 +215,10 @@ def template(text, vars):
''' run a text buffer through the templating engine until it no longer changes '''
prev_text = ''
try:
text = text.decode('utf-8')
except UnicodeEncodeError:
pass # already unicode
depth = 0
while prev_text != text:
depth = depth + 1
......
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