Update src/yunohost/service.py

This commit is contained in:
Alexandre Aubin 2020-05-06 20:18:49 +02:00 committed by GitHub
parent 58a29f218e
commit f25e07fd82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -427,8 +427,11 @@ 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, number) if os.path.exists(log_path) else []
if os.path.isfile(log_path):
result[log_path] = _tail(log_path, number)
continue
elif not os.path.isdir(log_path):
result[log_path] = []
continue
for log_file in os.listdir(log_path):