Module: check_mk
Branch: master
Commit: dc80bea5cb3a0437780a12326b60f5fa62a66920
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dc80bea5cb3a04…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 16 09:02:13 2013 +0100
FIX Hiding views related to not existing datasources, like the EC now
Customized views loading information from datasources which do not exist
anymore in multisite are now skipped during loading. In previous version,
these views resulted in exceptions / error messages in the GUI.
---
.bugs/1086 | 7 +++++--
.werks/312 | 11 +++++++++++
ChangeLog | 1 +
web/htdocs/views.py | 4 +++-
4 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/.bugs/1086 b/.bugs/1086
index b248248..3784921 100644
--- a/.bugs/1086
+++ b/.bugs/1086
@@ -1,9 +1,9 @@
Title: Exception in views when EC views are missing
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2013-12-03 10:12:05
Targetversion: future
-Class: bug
When you enabled the Event Console, modify an EC view and afterwards
disabled the EC again, then the views the modified views base on
@@ -11,3 +11,6 @@ are missing - and also the columns and filters. This leads to
exceptions
in other views.
Solution: validate views, catch exceptions.
+
+2013-12-16 09:00:27: changed state open -> done
+Has just been fixed. Only views for existing datasources are loaded into multisite now.
diff --git a/.werks/312 b/.werks/312
new file mode 100644
index 0000000..7a4ed7e
--- /dev/null
+++ b/.werks/312
@@ -0,0 +1,11 @@
+Title: Hiding views related to not existing datasources, like the EC now
+Level: 1
+Component: multisite
+Version: 1.2.3i8
+Date: 1387180830
+Class: fix
+
+Customized views loading information from datasources which do not exist
+anymore in multisite are now skipped during loading. In previous version,
+these views resulted in exceptions / error messages in the GUI.
+
diff --git a/ChangeLog b/ChangeLog
index 552663d..bd21c90 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@
* 0302 FIX: Fixed highlight of choosen elements in foldertee/views snapin in
Chrome/IE
* 0239 FIX: Fixed incorrect html formatting when displaying host or service
comments...
* 0307 FIX: Increased performance of multisite GUI with a large userbase...
+ * 0312 FIX: Hiding views related to not existing datasources, like the EC now...
WATO:
* 0308 Multisite can now set rotation view permissions for NagVis...
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 1b7c118..067f0d8 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -261,7 +261,9 @@ def load_views():
for name, view in views.items():
view["owner"] = user
view["name"] = name
- html.multisite_views[(user, name)] = view
+
+ if view['datasource'] in multisite_datasources:
+ html.multisite_views[(user, name)] = view
except SyntaxError, e:
raise MKGeneralException(_("Cannot load views from %s/views.mk:
%s") % (dirpath, e))