Module: check_mk
Branch: master
Commit: 7cef5ea1f49486da951caf61217fc3cff301d61d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7cef5ea1f49486…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Feb 26 11:38:24 2015 +0100
#2020 FIX Fixed non working FOREACH_CHILD mechanism for BI rules
---
.werks/2020 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/bi.py | 8 ++++----
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/.werks/2020 b/.werks/2020
new file mode 100644
index 0000000..57b6a0f
--- /dev/null
+++ b/.werks/2020
@@ -0,0 +1,10 @@
+Title: Fixed non working FOREACH_CHILD mechanism for BI rules
+Level: 1
+Component: bi
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1424946934
+
+
diff --git a/ChangeLog b/ChangeLog
index 95f40b2..7eee12c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -293,6 +293,7 @@
BI:
* 1784 FIX: Fix exception in BI Boxes when parents are being used
+ * 2020 FIX: Fixed non working FOREACH_CHILD mechanism for BI rules
Reporting & Availability:
* 1990 FIX: Fix two exceptions in PDF exports of host group views
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index 95d74ce..a0f4fc8 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -575,14 +575,14 @@ def find_matching_services(aggr_type, what, calllist):
if host_matches != None:
if what == config.FOREACH_CHILD:
list_of_matches = [ host_matches + (child,) for child in childs ]
- if what == config.FOREACH_PARENT:
+ elif what == config.FOREACH_PARENT:
list_of_matches = [ host_matches + (parent,) for parent in parents ]
else:
list_of_matches = [ host_matches ]
- for host_matches in list_of_matches:
+ for matched_host in list_of_matches:
if service_re == config.HOST_STATE:
- matches.add(host_matches)
+ matches.add(matched_host)
else:
for service in services:
mo = (service_re, service)
@@ -591,7 +591,7 @@ def find_matching_services(aggr_type, what, calllist):
m = regex(service_re).match(service)
if m:
svc_matches = tuple(m.groups())
- matches.add(host_matches + svc_matches)
+ matches.add(matched_host + svc_matches)
else:
service_nomatch_cache.add(mo)