Module: check_mk
Branch: master
Commit: fbc38e926e35081b182eef751191480b7364dd73
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fbc38e926e3508…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Oct 16 13:14:00 2018 +0200
6784 FIX Fixed grouping of service description KeyError exception
When using the service description grouping of views a KeyError could
occur while rendering the view in case some of the pattern matching
services is not in OK state or stale.
Change-Id: I6877db6119413dec36ef8c71240d1cf58ba18925
---
.werks/6784 | 13 +++++++++++++
cmk/gui/plugins/views/layouts.py | 3 ++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/6784 b/.werks/6784
new file mode 100644
index 0000000..92c3fe8
--- /dev/null
+++ b/.werks/6784
@@ -0,0 +1,13 @@
+Title: Fixed grouping of service description KeyError exception
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1539688295
+
+When using the service description grouping of views a KeyError could
+occur while rendering the view in case some of the pattern matching
+services is not in OK state or stale.
diff --git a/cmk/gui/plugins/views/layouts.py b/cmk/gui/plugins/views/layouts.py
index abf94b6..ae8d011 100644
--- a/cmk/gui/plugins/views/layouts.py
+++ b/cmk/gui/plugins/views/layouts.py
@@ -342,6 +342,8 @@ def calculate_view_grouping_of_services(rows, row_group_cells):
elif current_group != group_spec:
group_id = row_id
+ groups.setdefault(group_id, (group_spec, []))
+
# When the service is not OK and should not be grouped, move it's row
# in front of the group.
if row.get("service_state", -1) != 0 or is_stale(row):
@@ -354,7 +356,6 @@ def calculate_view_grouping_of_services(rows, row_group_cells):
continue
current_group = group_spec
- groups.setdefault(group_id, (group_spec, []))
groups[group_id][1].append(row_id)
# Now create the final structure as described above