Module: check_mk
Branch: master
Commit: 0d5d1f4cd1c27ec4a5fa659fc0b7ee5e3da035dc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0d5d1f4cd1c27e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jun 29 12:20:55 2015 +0200
#2361 FIX Fix exception for missing key 'title' in certain cases of older
customized views
---
.werks/2361 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/visuals.py | 8 ++++----
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/.werks/2361 b/.werks/2361
new file mode 100644
index 0000000..c25dcdf
--- /dev/null
+++ b/.werks/2361
@@ -0,0 +1,10 @@
+Title: Fix exception for missing key 'title' in certain cases of older customized
views
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1435573224
+
+
diff --git a/ChangeLog b/ChangeLog
index b0b5941..3d73105 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
Multisite:
* 2314 FIX: Availability: fixed exception when grouping by host or service group
+ * 2361 FIX: Fix exception for missing key 'title' in certain cases of older
customized views
WATO:
* 2344 FIX: Improved validation of selected rules when editing BI aggregations...
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index 7a97e65..81b65d4 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -160,15 +160,15 @@ def load(what, builtin_visuals, skip_func = None):
if attr not in visual and attr in builtin_visual:
visual[attr] = builtin_visual[attr]
+ # Repair visuals with missing 'title' or 'description'
+ visual.setdefault("title", name)
+ visual.setdefault("description", "")
+
# Declare custom permissions
declare_visual_permission(what, name, visual)
visuals[(user, name)] = visual
- # Repair visuals with missing 'title' or 'description'
- for key in [ "title", "description" ]:
- if key not in visual:
- visual[key] = _("Missing %s") % key
except SyntaxError, e:
raise MKGeneralException(_("Cannot load %s from %s: %s") % (what,
path, e))