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>2013-11-07 01:23:54 -0500
commit8ff8ee837357c54bb8845df2c7a30ec05da02367 (patch)
tree485419d306f2f2f3c28ee2aabe5f7d5f4d9852cc
parent889a90422dd47284dffa32b9234a6e58991b000c (diff)
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--src/python-systemd/journal.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/python-systemd/journal.py b/src/python-systemd/journal.py
index d0bcd24d15..9c7e0045e5 100644
--- a/src/python-systemd/journal.py
+++ b/src/python-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