mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-06 13:41:31 +00:00
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.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
7f6c814a70
commit
0ea2d31ba7
@@ -351,6 +351,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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user