Commit 94f56614 by Grzegorz Nosek Committed by Michael DeHaan

Fix UTF-8 output when using executable inventory files

The 'hostname' variable is then unicode, which breaks interpolating
stdout etc. contents into the output strings (they are bytes and cannot
be converted to Unicode using ASCII codec)
parent 73b0dd4a
......@@ -136,6 +136,9 @@ def command_generic_msg(hostname, result, oneline, caption):
stderr = result.get('stderr', '')
msg = result.get('msg', '')
hostname = hostname.encode('utf-8')
caption = caption.encode('utf-8')
if not oneline:
buf = "%s | %s | rc=%s >>\n" % (hostname, caption, result.get('rc',0))
if stdout:
......
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