Module: check_mk
Branch: master
Commit: b958e9fc7d668740fc967033b0dc403467c9994e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b958e9fc7d6687…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 20 11:46:16 2017 +0100
4381 FIX Fixed exception when WATO ruleset without main group definition exists
An exception "AttributeError ('NoneType' object has no attribute
'title')" could occur on
WATO ruleset list pages when a custom Check_MK ruleset definition exists without previous
register_rulegroup() call for the main group.
Change-Id: I188ae4404086ffa82b9c83a44a4f6bb8a84a641a
---
.werks/4381 | 11 +++++++++++
web/htdocs/watolib.py | 6 +++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/4381 b/.werks/4381
new file mode 100644
index 0000000..947ec16
--- /dev/null
+++ b/.werks/4381
@@ -0,0 +1,11 @@
+Title: Fixed exception when WATO ruleset without main group definition exists
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.5.0i1
+Date: 1487587493
+Class: fix
+
+An exception "AttributeError ('NoneType' object has no attribute
'title')" could occur on
+WATO ruleset list pages when a custom Check_MK ruleset definition exists without
previous
+register_rulegroup() call for the main group.
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index cab353d..63786cc 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -5913,7 +5913,11 @@ class Rulespecs(object):
choices = []
for main_group_name in self.get_main_groups():
- main_group_title = g_rulegroups.get(main_group_name).title
+ main_group = g_rulegroups.get(main_group_name)
+ if main_group:
+ main_group_title = main_group.title
+ else:
+ main_group_title = main_group_name
if mode == "static_checks" and main_group_name !=
"static":
continue