Module: check_mk
Branch: master
Commit: 4a5d81af9d810dd573df164d82fc19a77081f91d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4a5d81af9d810d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 3 09:46:05 2017 +0100
4318 FIX Rule editor: Fixed wrong default value for yes/no rulesets
Change-Id: I6f9b47e80df25a5138c0ca3b7eb085fe86c00b83
---
.werks/4318 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 1 -
web/htdocs/watolib.py | 6 +++++-
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/.werks/4318 b/.werks/4318
new file mode 100644
index 0000000..f46b362
--- /dev/null
+++ b/.werks/4318
@@ -0,0 +1,9 @@
+Title: Rule editor: Fixed wrong default value for yes/no rulesets
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.4.0i4
+Date: 1486111533
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 5b9fcc9..4bc55d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -126,6 +126,7 @@
* 4237 FIX: Fixed rendering of old timestamps...
* 4231 FIX: Fixed broken host renaming when files are in var/check_mk/web
* 4317 FIX: Rule list: Removed the row limit of the rule tables
+ * 4318 FIX: Rule editor: Fixed wrong default value for yes/no rulesets
Notifications:
* 4197 FIX: Fix sending notification to global fallback email address
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 6d59833..9b94877 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -12946,7 +12946,6 @@ class ModeEditRule(WatoMode):
for posneg, img in [ ("positive", "yes"),
("negative", "no")]:
val = img == "yes"
html.img("images/rule_%s.png" % img,
class_="ruleyesno", align="top")
-
html.radiobutton("value", img, self._rule.value == val,
_("Make the outcome of the ruleset <b>%s</b><br>") % posneg)
# Conditions
forms.header(_("Conditions"))
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index f7fdf4c..8e3c979 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -6545,12 +6545,16 @@ class Rule(object):
def _initialize(self):
- self.value = None
self.tag_specs = []
self.host_list = []
self.item_list = None
self.rule_options = {}
+ if self.ruleset.valuespec():
+ self.value = None
+ else:
+ self.value = True
+
def from_config(self, rule_config):
try: