Module: check_mk
Branch: master
Commit: 5ca7aaaa8c3ac18993610725fbb2b7963b1ff507
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5ca7aaaa8c3ac1…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Mar 1 12:16:27 2013 +0100
FIX: single host aggregations didnt work for aggregations += [...]
---
ChangeLog | 1 +
web/htdocs/bi.py | 6 ++++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2c84343..1e04ed6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -89,6 +89,7 @@
* FIX: fix styling of top/down and bottom/up views (borders, padding)
* FIX: fix style of mouse pointer over BI boxes
* FIX: list of BI aggregates was incomplete in some cases
+ * FIX: single host aggregations didn't work for aggregations += [...]
* Make titles of non-leaf tree nodes klickable
WATO:
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index 3e2de1a..78a6961 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -376,6 +376,7 @@ def compile_forest(user, only_hosts = None, only_groups = None):
# in the list of required nodes.
# Before the latest change this used the last item of the
req_hosts. I think it
# would be better to register this for all hosts mentioned in
req_hosts. Give it a try...
+ # ASSERT: len(req_hosts) == 1!
for host in req_hosts:
if not only_hosts or host in only_hosts:
cache["host_aggregations"].setdefault(host,
[]).append((group, aggr))
@@ -383,6 +384,11 @@ def compile_forest(user, only_hosts = None, only_groups = None):
# construct a list of compiled single-host aggregations
for cached registration
single_affected_hosts.append(host)
+ # Also all other aggregations that contain exactly one hosts are
considered to
+ # be "single host aggregations"
+ elif len(req_hosts) == 1:
+ cache["host_aggregations"].setdefault(req_hosts[0],
[]).append((group, aggr))
+
# All aggregations containing a specific host
for h in req_hosts:
cache["affected_hosts"].setdefault(h,
[]).append((group, aggr))