Module: check_mk
Branch: master
Commit: 8bc6f153605655ae8521c604a69f5d994e566f9b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8bc6f153605655…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 26 15:51:29 2018 +0100
Another addition to werk #5866
Change-Id: I0e7a98a1386c00149a8362fdda8e97d34bf98b30
---
web/htdocs/watolib.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 83610eb..44bc83a 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -8281,20 +8281,20 @@ class Rule(object):
def get_mismatch_reasons(self, host_folder, hostname, item):
"""A generator that provides the reasons why a given folder/host/item not matches this rule"""
host = host_folder.host(hostname)
- host_tags = host.tags()
if not self._matches_hostname(hostname):
yield _("The host name does not match.")
+ if not self.folder.is_transitive_parent_of(host_folder):
+ yield _("The rule does not apply to the folder of the host.")
+
+ host_tags = host.tags()
for tag in self.tag_specs:
if tag[0] != '/' and tag[0] != '!' and tag not in host_tags:
yield _("The host is missing the tag %s") % tag
elif tag[0] == '!' and tag[1:] in host_tags:
yield _("The host has the tag %s") % tag
- if not self.folder.is_transitive_parent_of(host_folder):
- yield _("The rule does not apply to the folder of the host.")
-
if item != NO_ITEM and self.ruleset.item_type():
if not self.matches_item(item):
yield _("The %s \"%s\" does not match this rule.") % \
Module: check_mk
Branch: master
Commit: a4f234670bc641ea6ed3a30d79e0d14e87337e8c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a4f234670bc641…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Feb 26 15:20:37 2018 +0100
Moved all paths into cmk.ec.settings, making it the only source of truth for this.
Change-Id: Ic539e8e623c57426ae58f6de2fb266d897dbd088
---
bin/mkeventd | 65 ++++++++++++++++--------------------------------------
cmk/ec/settings.py | 52 +++++++++++++++++++++++++++++--------------
2 files changed, 54 insertions(+), 63 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=a4f234670b…
Module: check_mk
Branch: master
Commit: 161b3457037f99bb53722844c8330acebd92a022
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=161b3457037f99…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 26 15:49:02 2018 +0100
Addition to werk #5866
Change-Id: Ie9c08c8fdc49c0e13a31c0bd100cae56a31a5a0b
---
web/htdocs/watolib.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index da1f52e..83610eb 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -8281,14 +8281,15 @@ class Rule(object):
def get_mismatch_reasons(self, host_folder, hostname, item):
"""A generator that provides the reasons why a given folder/host/item not matches this rule"""
host = host_folder.host(hostname)
+ host_tags = host.tags()
if not self._matches_hostname(hostname):
yield _("The host name does not match.")
for tag in self.tag_specs:
- if tag[0] != '/' and tag[0] != '!' and tag not in host.tags():
+ if tag[0] != '/' and tag[0] != '!' and tag not in host_tags:
yield _("The host is missing the tag %s") % tag
- elif tag[0] == '!' and tag[1:] in host.tags():
+ elif tag[0] == '!' and tag[1:] in host_tags:
yield _("The host has the tag %s") % tag
if not self.folder.is_transitive_parent_of(host_folder):