summaryrefslogtreecommitdiff
path: root/src/system/vyos-event-handler.py
diff options
context:
space:
mode:
authorgavol <34028214+gavol@users.noreply.github.com>2024-02-18 21:23:13 +0100
committergavol <34028214+gavol@users.noreply.github.com>2024-02-19 19:07:30 +0100
commitb678009b484eb6d20fceb5db00b0dc62344296a2 (patch)
tree7908bb5f28dace6d026b73aee1bd6a3219abaf0b /src/system/vyos-event-handler.py
parentde0669a15365f97ccf89b02c8223434e618a8ac4 (diff)
downloadvyos-1x-b678009b484eb6d20fceb5db00b0dc62344296a2.tar.gz
vyos-1x-b678009b484eb6d20fceb5db00b0dc62344296a2.zip
event-handler: T6048: handling exception when _PID is not found
Diffstat (limited to 'src/system/vyos-event-handler.py')
-rwxr-xr-xsrc/system/vyos-event-handler.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/system/vyos-event-handler.py b/src/system/vyos-event-handler.py
index 74112ec91..dd2793046 100755
--- a/src/system/vyos-event-handler.py
+++ b/src/system/vyos-event-handler.py
@@ -153,7 +153,12 @@ if __name__ == '__main__':
continue
for entry in data:
message = entry['MESSAGE']
- pid = entry['_PID']
+ pid = -1
+ try:
+ pid = entry['_PID']
+ except Exception as ex:
+ journal.send(f'Unable to extract PID from message entry: {entry}', SYSLOG_IDENTIFIER=my_name)
+ continue
# Skip empty messages and messages from this process
if message and pid != my_pid:
try: