mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
syslog.openlog does not cope with unicode first argument
It seems that os.path.basename(__file__) can return a unicode string. In this case syslog.openlog fails. Forcing the result to a string causes the resulting error to go away.
This commit is contained in:
@@ -549,7 +549,7 @@ class AnsibleModule(object):
|
|||||||
journal.sendv(*journal_args)
|
journal.sendv(*journal_args)
|
||||||
else:
|
else:
|
||||||
msg = ''
|
msg = ''
|
||||||
syslog.openlog('ansible-%s' % os.path.basename(__file__), 0, syslog.LOG_USER)
|
syslog.openlog('ansible-%s' % str(os.path.basename(__file__)), 0, syslog.LOG_USER)
|
||||||
for arg in log_args:
|
for arg in log_args:
|
||||||
msg = msg + arg + '=' + str(log_args[arg]) + ' '
|
msg = msg + arg + '=' + str(log_args[arg]) + ' '
|
||||||
if msg:
|
if msg:
|
||||||
|
|||||||
Reference in New Issue
Block a user