diff options
author | Christian Breunig <christian@breunig.cc> | 2024-02-20 21:41:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 21:41:44 +0100 |
commit | 8191ff673d317c09eea69fd521e4a2af931ddc91 (patch) | |
tree | f255ac608bdb24c4248062091655153d64817b0a | |
parent | 89f1ac00262bb1e21e5e9228fc8948a1e4eb26e8 (diff) | |
parent | b678009b484eb6d20fceb5db00b0dc62344296a2 (diff) | |
download | vyos-1x-8191ff673d317c09eea69fd521e4a2af931ddc91.tar.gz vyos-1x-8191ff673d317c09eea69fd521e4a2af931ddc91.zip |
Merge pull request #3032 from gavol/current
vyos-event-handler.py: T6048: handling exception when _PID is not found
-rwxr-xr-x | src/system/vyos-event-handler.py | 7 |
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: |