Module: check_mk
Branch: master
Commit: 7221fcec3e09d0aabd3285507dbeb2129c590a20
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7221fcec3e09d0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 5 13:35:42 2016 +0100
4128 FIX Fixed exception in "Virtual host tree" snapin in case a user tries to
access a not existing tree
---
.werks/4128 | 10 ++++++++++
ChangeLog | 1 +
web/plugins/sidebar/shipped.py | 7 +++++--
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/4128 b/.werks/4128
new file mode 100644
index 0000000..a495669
--- /dev/null
+++ b/.werks/4128
@@ -0,0 +1,10 @@
+Title: Fixed exception in "Virtual host tree" snapin in case a user tries to
access a not existing tree
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i3
+Date: 1480941304
+
+
diff --git a/ChangeLog b/ChangeLog
index 2dd9262..be8768d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -61,6 +61,7 @@
* 4072 FIX: Fixed multiple issues in BI availability when groups or names contain
umlauts
* 4080 FIX: Fixed possible exception "unsupported operand type" in matrix
views
* 4127 FIX: Fixed possible "maximum recursion depth exceeded" error when
sorting tables with a lot of text in cells
+ * 4128 FIX: Fixed exception in "Virtual host tree" snapin in case a user
tries to access a not existing tree
WATO:
* 3984 Permissions can now be filtered by providing a search term on the "edit
role" page...
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index 2350bc3..83766ff 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -2056,7 +2056,6 @@ def render_tag_tree():
if type(tree_conf) == int:
tree_conf = {"tree": tree_conf, "cwd":{}} # convert from old
style
-
choices = [ (str(i), v[0]) for i, v in enumerate(config.virtual_host_trees)]
html.begin_form("vtree")
@@ -2071,7 +2070,11 @@ def render_tag_tree():
html.end_form()
html.final_javascript(virtual_host_tree_js)
- title, taggroups = config.virtual_host_trees[tree_conf["tree"]]
+ try:
+ title, taggroups = config.virtual_host_trees[tree_conf["tree"]]
+ except IndexError:
+ # Fallback to first host tree in case the wanted does not exist (anymore)
+ title, taggroups = config.virtual_host_trees[0]
tree = compute_tag_tree(taggroups)
render_tag_tree_level(taggroups, [], cwd, _("Virtual Host Tree"), tree)