From 1aa7aaefc00e26289006d90b905cf8f34e0a326a Mon Sep 17 00:00:00 2001 From: "sergey.kitov" Date: Mon, 17 Apr 2023 16:21:33 +0300 Subject: [PATCH] koremonitor.py: b64 encode bytes journal record fields. koremonitor couldn't proceed when journal record contain bytes field like 'COREDUMP_PROC_AUXV' --- koremonitor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/koremonitor.py b/koremonitor.py index 9cc4c27..afdb4f2 100755 --- a/koremonitor.py +++ b/koremonitor.py @@ -9,6 +9,7 @@ Generates /koredump/index.json with data on available cores. """ +import base64 import json import logging import os @@ -143,6 +144,8 @@ def fmt_journal_entry(self, entry): entry[k] = str(v.timestamp) elif isinstance(v, datetime): entry[k] = v.isoformat() + "Z" + elif isinstance(v, bytes): + entry[k] = base64.b64encode(v).decode('ascii') elif not isinstance(v, (str, int)): self.logger.error(k, v) return entry