summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Marko <rmarko@fedoraproject.org>2013-11-05 15:41:20 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-07-05 14:19:21 -0400
commit7bb40a26e0a228b0a6ad4871661838a8facd7eb5 (patch)
treeed82e23cddda9afae3988e77b3f4fefafd7e175a
parent39970127f2f05b39dc38f073dd3d60657edc8508 (diff)
downloadpython-systemd-7bb40a26e0a228b0a6ad4871661838a8facd7eb5.tar.gz
systemd-python: convert keyword value to string
Allows using journal.send('msg', PRIORITY=journal.LOG_CRIT) Before this commit this results in TypeError: cannot concatenate 'str' and 'int' objects and requires passing PRIORITY value as string to work.
-rw-r--r--systemd/journal.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/systemd/journal.py b/systemd/journal.py
index d0bcd24..9c7e004 100644
--- a/systemd/journal.py
+++ b/systemd/journal.py
@@ -352,6 +352,8 @@ def get_catalog(mid):
def _make_line(field, value):
if isinstance(value, bytes):
return field.encode('utf-8') + b'=' + value
+ elif isinstance(value, int):
+ return field + '=' + str(value)
else:
return field + '=' + value