1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-03-21 18:50:38 +03:00

Don't do anything if log metadata is not JSON-encodable

This commit is contained in:
Игорь Чудов 2020-09-09 19:54:43 +04:00
parent 1f6b7d4cb7
commit 8f96b1be85
Signed by untrusted user: nir
GPG Key ID: 0F3883600CAE7AAC

View File

@ -52,7 +52,11 @@ class slogm(object):
#args.update(dict({'timestamp': now, 'message': str(self.message)}))
args.update(self.kwargs)
kwa = encoder().encode(args)
kwa = dict()
try:
kwa = encoder().encode(args)
except Exception as exc:
pass
result = '{}|{}|{}'.format(now, self.message, kwa)