mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Properly handle case where no match from grep
This commit is contained in:
parent
8b98360fd2
commit
50f68e2886
1 changed files with 2 additions and 2 deletions
|
@ -119,8 +119,8 @@ class SystemResourcesDiagnoser(Diagnoser):
|
|||
def analyzed_kern_log():
|
||||
|
||||
cmd = 'tail -n 10000 /var/log/kern.log | grep "oom_reaper: reaped process" || true'
|
||||
out = subprocess.check_output(cmd, shell=True)
|
||||
lines = out.strip().split("\n")
|
||||
out = subprocess.check_output(cmd, shell=True).strip()
|
||||
lines = out.split("\n") if out else []
|
||||
|
||||
now = datetime.datetime.now()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue