chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
889a904
)
systemd-python: convert keyword value to string
author
Richard Marko
<rmarko@fedoraproject.org>
Tue, 5 Nov 2013 14:41:20 +0000
(15:41 +0100)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Thu, 7 Nov 2013 06:23:54 +0000
(
01:23
-0500)
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
patch
|
blob
|
history
diff --git
a/src/python-systemd/journal.py
b/src/python-systemd/journal.py
index d0bcd24d1501aa8b800083259947c9320dd4ae36..9c7e0045e5fddce2a9c354894e009b2f51d23c1e 100644
(file)
--- 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