Module: check_mk
Branch: master
Commit: 6fe3fd990c97774a8e6213d31d09444d9a209d2e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6fe3fd990c9777…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 24 10:45:19 2017 +0100
4512 FIX Rule list: Fixed possible "assert table" error on ruleset rule listing
page
This issue could occur in specific situations when having a specific folder hierarchy
while some folders have no rule assigned and some have.
Change-Id: I39430fb8ff7f4251d8f29e39ec10f87cd6268837
---
.werks/4512 | 12 ++++++++++++
web/htdocs/wato.py | 13 +++++++------
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/.werks/4512 b/.werks/4512
new file mode 100644
index 0000000..217f9dc
--- /dev/null
+++ b/.werks/4512
@@ -0,0 +1,12 @@
+Title: Rule list: Fixed possible "assert table" error on ruleset rule listing
page
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1490348642
+
+This issue could occur in specific situations when having a specific folder hierarchy
+while some folders have no rule assigned and some have.
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index c76c8193..f6280cf 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -12839,18 +12839,19 @@ class ModeEditRuleset(WatoMode):
skip_this_folder = False
for folder, rulenr, rule in ruleset.get_rules():
if folder != last_folder:
- skip_this_folder = False
+ if not Folder.current().is_root() and not
folder.is_transitive_parent_of(Folder.current()):
+ skip_this_folder = True
+ continue
+ else:
+ skip_this_folder = False
+
if last_folder != None:
table.end()
first_in_group = True
- alias_path = folder.alias_path(show_main = False)
last_folder = folder
- if not Folder.current().is_root() and not
folder.is_transitive_parent_of(Folder.current()):
- skip_this_folder = True
- continue
-
+ alias_path = folder.alias_path(show_main = False)
table.begin("rules", title="%s %s" % (_("Rules
in folder"), alias_path),
css="ruleset", searchable=False, sortable=False,
limit=None)
else: