Module: check_mk
Branch: master
Commit: 3d4ebb2a572d631111bec95b4454555a2a9dd84d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3d4ebb2a572d63…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jun 6 12:38:47 2012 +0200
FIX: fix negating hosts in rule editor
---
ChangeLog | 1 +
web/htdocs/wato.py | 4 +++-
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 46d3dae..bce515b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
* FIX: add missing icon on cluster hosts to WATO in Multisite views
* FIX: fix search field in host table if more than 10 hosts are shown
* FIX: fix bulk edit and form properties (visibility of attributes was broken)
+ * FIX: fix negating hosts in rule editor
Checks & Agents:
* fileinfo: added this check to Linux agent. Simply put your
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index b03443b..b30eea3 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -9885,6 +9885,8 @@ def get_rule_conditions(ruleset):
negate = html.get_checkbox("negate_hosts")
nr = 0
host_list = ListOfStrings().from_html_vars("hostlist")
+ if negate:
+ host_list = [ "!" + h for h in host_list ]
# append ALL_HOSTS to negated host lists
if len(host_list) > 0 and host_list[0][0] == '!':
host_list += ALL_HOSTS
@@ -10031,7 +10033,7 @@ def mode_edit_rule(phase):
valuespec = TextAscii(size = 30)).render_input("hostlist",
explicit_hosts)
html.checkbox("negate_hosts", negate_hosts, label =
- _("<b>Negate:</b> make Rule apply for <b>all
but</b> the above hosts"))
+ _("<b>Negate:</b> make rule apply for <b>all
but</b> the above hosts"))
html.write("</div>")
html.help(_("You can enter a number of explicit host names that rule should or
should "
"not apply to here. Leave this option disabled if you want the rule
to "