Module: check_mk
Branch: master
Commit: 40507b4938c633cb224a6d6d6438f773fd495cad
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=40507b4938c633…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jan 23 09:55:45 2019 +0100
Fixed multiple registrations of static check parameter rulesets (was only an internal
issue)
CMK-1572
Change-Id: I9418a9d9f1770071789a5f48e8eca183e166e89f
---
cmk/gui/plugins/wato/utils/__init__.py | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/cmk/gui/plugins/wato/utils/__init__.py
b/cmk/gui/plugins/wato/utils/__init__.py
index 01cecc9..89b0f60 100644
--- a/cmk/gui/plugins/wato/utils/__init__.py
+++ b/cmk/gui/plugins/wato/utils/__init__.py
@@ -685,11 +685,15 @@ def register_check_parameters(subgroup,
# There is never a RulespecSubGroup declaration for the static checks.
# Create some based on the regular check groups which should have a definition
- main_group_static_class = rulespec_group_registry["static"]
- checkparams_static_sub_group_class = type("%sStatic" %
subgroup.__name__, (subgroup,), {
- "main_group": main_group_static_class,
- })
- rulespec_group_registry.register(checkparams_static_sub_group_class)
+ try:
+ subgroup_key = "static/" + subgroup().sub_group_name
+ checkparams_static_sub_group_class = rulespec_group_registry[subgroup_key]
+ except KeyError:
+ main_group_static_class = rulespec_group_registry["static"]
+ checkparams_static_sub_group_class = type("%sStatic" %
subgroup.__name__, (subgroup,), {
+ "main_group": main_group_static_class,
+ })
+ rulespec_group_registry.register(checkparams_static_sub_group_class)
register_rule(
checkparams_static_sub_group_class,