mirror of
https://github.com/Telecominfraproject/ols-nos.git
synced 2025-11-05 12:38:08 +00:00
[proc-exit-listener]: ignore blank lines
make proc-exit-listener more rebust Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import getopt
|
||||
import os
|
||||
import re
|
||||
import select
|
||||
import signal
|
||||
import sys
|
||||
@@ -40,6 +41,9 @@ def get_critical_group_and_process_list():
|
||||
|
||||
with open(CRITICAL_PROCESSES_FILE, 'r') as file:
|
||||
for line in file:
|
||||
# ignore blank lines
|
||||
if re.match(r"^\s*$", line)
|
||||
continue
|
||||
line_info = line.strip(' \n').split(':')
|
||||
if len(line_info) != 2:
|
||||
syslog.syslog(syslog.LOG_ERR,
|
||||
|
||||
Reference in New Issue
Block a user