From 3a6f3c37323adbfdc8ed53dcbfde79f536a4da75 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 31 May 2018 09:32:29 +0200 Subject: [PATCH] [fix] check if log exists before tailing to avoid errors --- src/yunohost/service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/yunohost/service.py b/src/yunohost/service.py index b252f0873..743efa6da 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -298,7 +298,7 @@ def service_log(name, number=50): for log_path in log_list: # log is a file, read it if not os.path.isdir(log_path): - result[log_path] = _tail(log_path, int(number)) + result[log_path] = _tail(log_path, int(number)) if os.path.exists(log_path) else [] continue for log_file in os.listdir(log_path): @@ -310,7 +310,7 @@ def service_log(name, number=50): if not log_file.endswith(".log"): continue - result[log_file_path] = _tail(log_file_path, int(number)) + result[log_file_path] = _tail(log_file_path, int(number)) if os.path.exists(log_file_path) else [] return result