Module: check_mk
Branch: master
Commit: 049db68360f08be26e4986753dbc2a1aa702ccd7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=049db68360f08b…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Mon Jun 13 15:25:41 2016 +0200
fixed exception introduced in werk 3141
---
web/htdocs/notifications.py | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/web/htdocs/notifications.py b/web/htdocs/notifications.py
index 2fdad25..26d1da9 100644
--- a/web/htdocs/notifications.py
+++ b/web/htdocs/notifications.py
@@ -28,6 +28,7 @@ from ast import literal_eval
import config
import defaults
import lib
+import errno
g_acknowledgement_path = defaults.var_dir + "/acknowledged_notifications.mk"
g_acknowledgement_time = None
@@ -50,12 +51,16 @@ def acknowledged_time():
def load_acknowledgements():
global g_acknowledgement_time
- with open(g_acknowledgement_path, "r") as f:
- content = f.read().strip()
- if content:
- g_acknowledgement_time = literal_eval(content)
-
- return []
+ try:
+ with open(g_acknowledgement_path, "r") as f:
+ content = f.read().strip()
+ if content:
+ g_acknowledgement_time = literal_eval(content)
+ except IOError, e:
+ if e.errno == errno.ENOENT:
+ g_acknowledgement_time = 0
+ else:
+ raise
def render_page_confirm(acktime, prev_url):
html.set_render_headfoot(False)