Skip to content
Permalink
Browse files

Fix set_ruleset Web-API call with boolean rulesets

CMK-2172

Change-Id: I158c0722ea10250a707a442078d6b05224bcdff0
  • Loading branch information
LarsMichelsen committed Jun 3, 2019
1 parent d035d02 commit 6ea3d2b8df578d2e52436935162b9dfe96e3de40
Showing with 6 additions and 0 deletions.
  1. +6 −0 cmk/gui/plugins/webapi/webapi.py
@@ -41,6 +41,7 @@
from cmk.gui.exceptions import MKUserError, MKAuthException, MKException
from cmk.gui.plugins.userdb.htpasswd import hash_password
import cmk.gui.watolib.users
from cmk.gui.valuespec import Checkbox
from cmk.gui.watolib.tags import (
TagConfigFile,)
from cmk.gui.watolib.groups import (
@@ -676,6 +677,11 @@ def _set(self, request):
for folder_path, rules in new_ruleset.items():
for rule in rules:
value = rule["value"]

# Binary rulesets currently don't have a valuespec attribute set.
if rule_vs is None:
rule_vs = Checkbox()

try:
rule_vs.validate_datatype(value, "test_value")
rule_vs.validate_value(value, "test_value")

0 comments on commit 6ea3d2b

Please sign in to comment.
You can’t perform that action at this time.