Module: check_mk
Branch: master
Commit: 52da62dbc48df81b56bb1449873e0de4e45faa79
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=52da62dbc48df8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu May 12 08:40:15 2016 +0200
3574 FIX Fixed broken aggregations snapin when using aggregations based on hard states
When creating an aggregation which bases it's state computation on hard states, this
lead to an exception in the sidebar snapin "classobj" not iterable.
---
.werks/3574 | 11 +++++++++++
ChangeLog | 1 +
web/htdocs/bi.py | 15 ++++++++++-----
3 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/.werks/3574 b/.werks/3574
new file mode 100644
index 0000000..003cb05
--- /dev/null
+++ b/.werks/3574
@@ -0,0 +1,11 @@
+Title: Fixed broken aggregations snapin when using aggregations based on hard states
+Level: 1
+Component: bi
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1463035142
+
+When creating an aggregation which bases it's state computation on hard states, this
+lead to an exception in the sidebar snapin "classobj" not iterable.
diff --git a/ChangeLog b/ChangeLog
index a9ed054..3986c6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -383,6 +383,7 @@
* 3358 FIX: Fixed BI Boxes views when "Enable BI compilation diagnostics"
enabled
* 3439 FIX: Fixed processing of BI aggregations containing umlauts
* 3440 FIX: Fixed possible BI exception "Unknown BI aggregation group
..."...
+ * 3574 FIX: Fixed broken aggregations snapin when using aggregations based on hard
states...
Reporting & Availability:
* 3267 New availability option for reclassifying host state
"unreachable"...
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index 7024a9d..8cfb1e5 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -178,13 +178,18 @@ def aggregation_groups():
migrate_bi_configuration() # convert bi_packs into legacy variables
# on demand: show all configured groups
group_names = set([])
- for a in config.aggregations + config.host_aggregations:
- if a[0] == config.DISABLED:
+ for entry in config.aggregations + config.host_aggregations:
+ if entry[0] == config.DISABLED:
continue
- if type(a[0]) == list:
- group_names.update(a[0])
+
+ if entry[0] == config.HARD_STATES:
+ entry = entry[1:]
+
+ if type(entry[0]) == list:
+ group_names.update(entry[0])
else:
- group_names.add(a[0])
+ group_names.add(entry[0])
+
group_names = list(group_names)
else: