Commit b6222abe by James Cammarata

Fix unicode decode error in syslog for modules

Fixes #6056
parent 18152684
...@@ -814,10 +814,10 @@ class AnsibleModule(object): ...@@ -814,10 +814,10 @@ class AnsibleModule(object):
except IOError, e: except IOError, e:
# fall back to syslog since logging to journal failed # fall back to syslog since logging to journal failed
syslog.openlog(str(module), 0, syslog.LOG_USER) syslog.openlog(str(module), 0, syslog.LOG_USER)
syslog.syslog(syslog.LOG_NOTICE, msg.decode('utf8').encode('utf8')) syslog.syslog(syslog.LOG_NOTICE, unicode(msg).encode('utf8'))
else: else:
syslog.openlog(str(module), 0, syslog.LOG_USER) syslog.openlog(str(module), 0, syslog.LOG_USER)
syslog.syslog(syslog.LOG_NOTICE, msg.decode('utf8').encode('utf8')) syslog.syslog(syslog.LOG_NOTICE, unicode(msg).encode('utf8'))
def get_bin_path(self, arg, required=False, opt_dirs=[]): def get_bin_path(self, arg, required=False, opt_dirs=[]):
''' '''
......
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