jinja2 cannot handle byte strs with non-ascii. So we need to transform potential byte str into unicode type. This fix is for dynamic inventory.

Fixes #10007
This commit is contained in:
Toshio Kuratomi 2015-01-26 20:37:20 -08:00
commit 915d232d5f
5 changed files with 42 additions and 4 deletions

View file

@ -456,6 +456,8 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
item = None
if type(results) == dict:
item = results.get('item', None)
host = utils.to_bytes(host)
results = utils.to_bytes(results)
if item:
msg = "fatal: [%s] => (item=%s) => %s" % (host, item, results)
else: