Module: check_mk
Branch: master
Commit: d5507f9df0a304c299cc30367118c6a4182af717
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d5507f9df0a304…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Feb 13 09:16:48 2012 +0100
FIX: fix prefix-tags rules (needed for WATO)
WATO rules on folders did not apply to subfolders
except rules for the main folder.
---
ChangeLog | 1 +
modules/check_mk.py | 9 ++++-----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0983113..1df497f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
information from one monitoring core and importing this
into another.
* Enable new check registration API (not yet used in checks)
+ * FIX: fix handling of prefix-tag rules (+), needed for WATO
WATO:
* Distributed WATO: Made all url calls using curl now
diff --git a/modules/check_mk.py b/modules/check_mk.py
index a8c246b..b34e3af 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -480,15 +480,14 @@ def hosttags_match_taglist(hosttags, required_tags):
for t in hosttags:
if t.startswith(tag):
matches = True
- if not matches:
- return False
+ break
else:
- if (tag in hosttags) == negate:
- return False
+ matches = (tag in hosttags)
- if (tag in hosttags) == negate:
+ if matches == negate:
return False
+
return True
# +----------------------------------------------------------------------+