Module: check_mk
Branch: master
Commit: 2f6e0b09080e9b3d760e2580649aada26ac90731
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2f6e0b09080e9b…
Author: Sven Rueß <sr(a)mathias-kettner.de>
Date: Mon Jun 6 13:40:29 2016 +0200
2239 FIX Fixed exception in WATO snapins Folders, Tree of folders and Virtual Host Tree
An exception is thrown, if you want to use the WATO snapins Folders, Tree of folders and
Virtual Host Tree in a distributed monitoring setup. The master site is used as viewer
for the slave sites. If you create folders on slave sites and activate one of the snapins
at teh master site there is an error shown like No WATO folder ... . This have been
fixed.
---
.werks/2239 | 13 +++++++++++++
ChangeLog | 1 +
web/plugins/sidebar/shipped.py | 3 ++-
web/plugins/sidebar/wato.py | 9 +++++----
4 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/.werks/2239 b/.werks/2239
new file mode 100644
index 0000000..07c04f0
--- /dev/null
+++ b/.werks/2239
@@ -0,0 +1,13 @@
+Title: Fixed exception in WATO snapins Folders, Tree of folders and Virtual Host Tree
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1465212884
+
+An exception is thrown, if you want to use the WATO snapins Folders, Tree of folders and
+Virtual Host Tree in a distributed monitoring setup. The master site is used as viewer
+for the slave sites. If you create folders on slave sites and activate one of the
snapins
+at teh master site there is an error shown like No WATO folder ... . This have been
fixed.
diff --git a/ChangeLog b/ChangeLog
index 4f45f9e..99a5756 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -338,6 +338,7 @@
* 3576 FIX: LDAP: Fixed "Internal error" when using the "Filter
Group" option in an LDAP connection...
* 3627 FIX: fixed double graphs of database size
* 3586 FIX: Fixed file locking issues (rare and random errors that settings file
could not be loaded)
+ * 2239 FIX: Fixed exception in WATO snapins Folders, Tree of folders and Virtual Host
Tree...
WATO:
* 3244 WATO BI Module: swap order of aggregation function and child node
selection...
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index c3f54f8..640450e 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -1619,7 +1619,8 @@ def compute_tag_tree(taglist):
if wato_folder.startswith("/wato/"):
folder_path = wato_folder[6:-9]
folder_path_components = folder_path.split("/")
- folder_titles = wato.get_folder_title_path(folder_path)[1:] # omit main
folder
+ if wato.Folder.folder_exists(folder_path):
+ folder_titles = wato.get_folder_title_path(folder_path)[1:] # omit
main folder
else:
folder_titles = []
diff --git a/web/plugins/sidebar/wato.py b/web/plugins/sidebar/wato.py
index 74b2cf8..f1dc800 100644
--- a/web/plugins/sidebar/wato.py
+++ b/web/plugins/sidebar/wato.py
@@ -146,10 +146,11 @@ def compute_foldertree():
for num_parts in range(0, len(path_parts)):
this_folder_path = '/'.join(path_parts[:num_parts])
- if this_folder_path not in user_folders:
- user_folders[this_folder_path] = get_folder(this_folder_path, num)
- else:
- user_folders[this_folder_path]['.num_hosts'] += num
+ if wato.Folder.folder_exists(this_folder_path):
+ if this_folder_path not in user_folders:
+ user_folders[this_folder_path] = get_folder(this_folder_path, num)
+ else:
+ user_folders[this_folder_path]['.num_hosts'] += num
#
# Now build the folder tree