Module: check_mk
Branch: master
Commit: 4ad5e4c96471f8783f1ec3bfc0a0f6c868d76372
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4ad5e4c96471f8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 2 15:22:40 2012 +0100
FIX: Fixed wrong label "Main Overview" shown for moved WATO folders
in foldertree snapin
---
ChangeLog | 2 ++
web/htdocs/wato.py | 3 +++
web/plugins/sidebar/wato.py | 9 +++++++--
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 66a912a..8d0dca1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -37,6 +37,8 @@
least one contact group.
* It is now possible to configure auxiliary tags via WATO
(formerly also called secondary tags)
+ * FIX: Fixed wrong label "Main Overview" shown for moved WATO folders
+ in foldertree snapin
Checks & Agents:
* hpux_if: fix missing default parameter errors
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 9be661b..83d627c 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -423,6 +423,9 @@ def save_folders(folder):
def save_all_folders():
save_folders(g_root_folder)
+def folder_config_exists(dir):
+ return os.path.exists(dir + "/.wato")
+
# Load the meta-data of a folder (it's .wato file), register
# it in g_folders, load recursively all subfolders and then
# return the folder object. The case the .wato file is missing
diff --git a/web/plugins/sidebar/wato.py b/web/plugins/sidebar/wato.py
index 0d4decb..8e18775 100644
--- a/web/plugins/sidebar/wato.py
+++ b/web/plugins/sidebar/wato.py
@@ -107,9 +107,12 @@ def render_wato_foldertree():
hosts.sort()
def get_folder(path, num = 0):
- wato_folder = wato.load_folder(wato.root_dir + path, childs = False)
+ wato_folder = {}
+ if wato.folder_config_exists(wato.root_dir + path):
+ wato_folder = wato.load_folder(wato.root_dir + path, childs = False)
+
return {
- 'title': wato_folder['title'],
+ 'title': wato_folder.get('title',
path.split('/')[-1]),
'.path': path,
'.num_hosts': num,
'.folders': {},
@@ -181,6 +184,8 @@ def render_wato_foldertree():
html.write('<span class=left>%s</span>' % _('View:'))
+ html.debug(repr(user_folders['']))
+
# Now render the whole tree
if user_folders:
render_tree_folder(user_folders[''])