Skip to content

Commit

Permalink
Fix set_ruleset Web-API call with boolean rulesets
Browse files Browse the repository at this point in the history
CMK-2172

Change-Id: I158c0722ea10250a707a442078d6b05224bcdff0
  • Loading branch information
LarsMichelsen committed Jun 4, 2019
1 parent d035d02 commit 6ea3d2b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmk/gui/plugins/webapi/webapi.py
Expand Up @@ -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 (
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 6ea3d2b

Please sign in to comment.