572a44
From f9c5cdfe9fe4d3ac8b075ed55d58f79cc067cdae Mon Sep 17 00:00:00 2001
572a44
From: Richard Marko <rmarko@fedoraproject.org>
572a44
Date: Tue, 5 Nov 2013 15:41:20 +0100
572a44
Subject: [PATCH] systemd-python: convert keyword value to string
572a44
572a44
Allows using journal.send('msg', PRIORITY=journal.LOG_CRIT)
572a44
572a44
Before this commit this results in
572a44
TypeError: cannot concatenate 'str' and 'int' objects
572a44
and requires passing PRIORITY value as string to work.
572a44
---
572a44
 src/python-systemd/journal.py | 2 ++
572a44
 1 file changed, 2 insertions(+)
572a44
572a44
diff --git a/src/python-systemd/journal.py b/src/python-systemd/journal.py
572a44
index d0bcd24..9c7e004 100644
572a44
--- a/src/python-systemd/journal.py
572a44
+++ b/src/python-systemd/journal.py
572a44
@@ -352,6 +352,8 @@ def get_catalog(mid):
572a44
 def _make_line(field, value):
572a44
         if isinstance(value, bytes):
572a44
                 return field.encode('utf-8') + b'=' + value
572a44
+        elif isinstance(value, int):
572a44
+                return field + '=' + str(value)
572a44
         else:
572a44
                 return field + '=' + value
572a44