Module: check_mk
Branch: master
Commit: 9f69dec121214ea05436ed9aa08c92503d373292
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9f69dec121214e…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Wed Mar 20 16:40:32 2019 +0100
_get_logfile_timespan: Make exception handling more granular
Change-Id: I3218ce531890a3706485d1e48a0426811383b98f
---
cmk/ec/history.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/cmk/ec/history.py b/cmk/ec/history.py
index 20e3193..417c7d6 100644
--- a/cmk/ec/history.py
+++ b/cmk/ec/history.py
@@ -571,10 +571,13 @@ def _get_logfile_timespan(path):
try:
with path.open(encoding="utf-8") as f:
first_entry = float(f.readline().split('\t', 1)[0])
+ except Exception:
+ first_entry = 0.0
+ try:
last_entry = path.stat().st_mtime
- return first_entry, last_entry
except Exception:
- return 0.0, 0.0
+ last_entry = 0.0
+ return first_entry, last_entry
# Rip out/replace any characters which have a special meaning in the UTF-8