Module: check_mk
Branch: master
Commit: 8a6d8443e313fb1e9008f27d1cbc1815136da35b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8a6d8443e313fb…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jul 13 09:51:24 2017 +0200
Fixed two recently introduced issues in virtual host tree snapin
Change-Id: I882312590ad8bb0a65273486b99331b6ba1b0cc0
---
web/plugins/sidebar/shipped.py | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index 9a281fa..6c30764 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -1951,7 +1951,7 @@ class VirtualHostTree(SidebarSnapin):
if "_children" not in subtree:
if self._is_tag_subdir(path, cwd):
- html.write(self._tag_tree_bullet(subtree["_state"],
subpath, True))
+ html.write(self._tag_tree_bullet(subtree.get("_state", 0),
subpath, True))
if subtree.get("_svc_problems"):
url = self._tag_tree_url(tree_spec, subpath,
"svcproblems")
html.icon_button(url, _("Show the service problems contained
in this branch"),
@@ -2185,13 +2185,12 @@ function virtual_host_tree_enter(path)
# Add the numbers/state of this host to the last level the host is invovled with
for tree_entry in this_level_branches:
- if not tree_entry:
- tree_entry.update({
- "_num_hosts" : 0,
- "_state" : 0,
- })
+ tree_entry.setdefault("_num_hosts", 0)
+ tree_entry.setdefault("_state", 0)
+
tree_entry["_num_hosts"] += 1
tree_entry["_svc_problems"] =
tree_entry.get("_svc_problems", False) or have_svc_problems
+
if state == 2 or tree_entry["_state"] == 2:
tree_entry["_state"] = 2
else: