Module: check_mk
Branch: master
Commit: eee91d2ba5718aee869bef24cfaee51563b11a0e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eee91d2ba5718a…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Jan 27 19:26:20 2014 +0100
FIX Multisite host tag filter: Now uses exact match
---
.werks/270 | 10 ++++++++++
ChangeLog | 1 +
web/plugins/views/filters.py | 2 +-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/270 b/.werks/270
new file mode 100644
index 0000000..12dafee
--- /dev/null
+++ b/.werks/270
@@ -0,0 +1,10 @@
+Title: Multisite host tag filter: Now uses exact match
+Level: 1
+Component: multisite
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1390847004
+
+Filtering for host tags could lead to wrong results, because the livestatus filter did
not look for an exact match.<br>
+If the filter was set to <tt>lan</tt>, hosts with <tt>wlan</tt>
or <tt>bland</tt> were also found.
diff --git a/ChangeLog b/ChangeLog
index 47c4cd9..44b53de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -185,6 +185,7 @@
* 0122 FIX: Multisite view editor not longer throwing a exception when loading views
from other users
* 0569 FIX: recurring updates of serial numbers of disabled ldap users fixed...
* 0676 FIX: Move view "Stale services" to Problems folder
+ * 0270 FIX: Multisite host tag filter: Now uses exact match...
WATO:
* 0308 Multisite can now set rotation view permissions for NagVis...
diff --git a/web/plugins/views/filters.py b/web/plugins/views/filters.py
index 5e00808..e3a839d 100644
--- a/web/plugins/views/filters.py
+++ b/web/plugins/views/filters.py
@@ -817,7 +817,7 @@ class FilterHostTags(Filter):
if op and val:
operator = op != 'is' and '!~' or '~'
- headers.append('Filter: host_custom_variables %s TAGS %s' %
(operator, val))
+ headers.append('Filter: host_custom_variables %s TAGS (^|[ ])%s($|[
])' % (operator, val))
if headers:
return '\n'.join(headers) + '\n'