summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Macken <lmacken@redhat.com>2014-12-24 11:31:44 -0700
committerJames Cammarata <jimi@sngx.net>2015-02-17 13:40:03 -0600
commit1f34e464adb1d38b75bde6b1f38f2fdd15f0c932 (patch)
tree85558cc3cebddbb68901eec4b11ebf75865481ae
parentb1f611fedb4280073a15a7b935ade17daf4651c8 (diff)
downloadansible-1f34e464adb1d38b75bde6b1f38f2fdd15f0c932.tar.gz
Use send instead of sendv on the systemd.journal (fixes #9886)
-rw-r--r--lib/ansible/module_utils/basic.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py
index 0d00b15064..6707381f53 100644
--- a/lib/ansible/module_utils/basic.py
+++ b/lib/ansible/module_utils/basic.py
@@ -1115,12 +1115,11 @@ class AnsibleModule(object):
msg = msg.encode('utf-8')
if (has_journal):
- journal_args = ["MESSAGE=%s %s" % (module, msg)]
- journal_args.append("MODULE=%s" % os.path.basename(__file__))
+ journal_args = [("MODULE", os.path.basename(__file__))]
for arg in log_args:
- journal_args.append(arg.upper() + "=" + str(log_args[arg]))
+ journal_args.append((arg.upper(), str(log_args[arg])))
try:
- journal.sendv(*journal_args)
+ journal.send("%s %s" % (module, msg), **dict(journal_args))
except IOError, e:
# fall back to syslog since logging to journal failed
syslog.openlog(str(module), 0, syslog.LOG_USER)