From 8ff8ee837357c54bb8845df2c7a30ec05da02367 Mon Sep 17 00:00:00 2001 From: Richard Marko Date: Tue, 5 Nov 2013 15:41:20 +0100 Subject: 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. --- src/python-systemd/journal.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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 -- cgit v1.2.3-54-g00ecf