Module: check_mk
Branch: master
Commit: 8ace6b3c9943405008ad9d0a3083079390dc50bd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8ace6b3c994340…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Thu Mar 3 15:03:58 2016 +0100
3086 FIX fixed incorrect host list when one wato folder was a substring of another
When a view is filtered by a wato folder, that search was a pure prefix match, so if a
view was
opened for the folder "abc" it would also contain all hosts from the folder
"abcde".
This affected (probably among other things) the "Virtual Host Tree" and the
"Tree of Folders"
snapins.
---
.werks/3086 | 13 +++++++++++++
ChangeLog | 1 +
web/plugins/visuals/wato.py | 2 ++
3 files changed, 16 insertions(+)
diff --git a/.werks/3086 b/.werks/3086
new file mode 100644
index 0000000..852397f
--- /dev/null
+++ b/.werks/3086
@@ -0,0 +1,13 @@
+Title: fixed incorrect host list when one wato folder was a substring of another
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1457013618
+
+When a view is filtered by a wato folder, that search was a pure prefix match, so if a
view was
+opened for the folder "abc" it would also contain all hosts from the folder
"abcde".
+This affected (probably among other things) the "Virtual Host Tree" and the
"Tree of Folders"
+snapins.
diff --git a/ChangeLog b/ChangeLog
index 559aadc..d85ebfc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -84,6 +84,7 @@
* 3246 FIX: Fix link for editing a BI aggregation after coming back from the details
of another aggregation...
* 3000 FIX: Host check command: "Use a custom check plugin" was not working
with CMC...
* 3231 FIX: Not showing network scan properties in host search form anymore
+ * 3086 FIX: fixed incorrect host list when one wato folder was a substring of
another...
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/plugins/visuals/wato.py b/web/plugins/visuals/wato.py
index 9c37ed5..646eae4 100644
--- a/web/plugins/visuals/wato.py
+++ b/web/plugins/visuals/wato.py
@@ -81,6 +81,8 @@ class FilterWatoFile(Filter):
path_regex = "^/wato/%s" % current.replace("\n",
"") # prevent insertions attack
if current.endswith("/"): # Hosts directly in this folder
path_regex += "hosts.mk"
+ else:
+ path_regex += "/"
if "*" in current: # used by virtual host tree snapin
path_regex = path_regex.replace(".",
"\\.").replace("*", ".*")
op = "~~"