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:
parent
889a90422d
commit
8ff8ee8373
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue