Module: check_mk
Branch: master
Commit: f788a4b9394ba2873082ad4a9ae0aba672eeafb5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f788a4b9394ba2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 19 16:19:16 2012 +0100
Snapshot/Factory Reset is possible even with a broken config
---
.bugs/596 | 7 +++++--
ChangeLog | 1 +
web/htdocs/wato.py | 16 +++++++++++++---
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/.bugs/596 b/.bugs/596
index a1898f3..9373209 100644
--- a/.bugs/596
+++ b/.bugs/596
@@ -1,8 +1,11 @@
Title: Wato verweist für die Hostag Konfiguration noch in die multisite.mk
Component: wato
-State: open
+Class: nastiness
+State: done
Date: 2012-01-13 18:21:44
Targetversion: 1.2.0
-Class: nastiness
Anstelle eines Links in die Multisite Einstellungen zu Host Tags, wird via Text auf die
multisite.mk verwiesen um hostags anzulegen
+
+2012-01-19 16:03:34: changed state open -> done
+Updated the text.
diff --git a/ChangeLog b/ChangeLog
index 63d5e2d..075ce76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -55,6 +55,7 @@
* Removed IP-Address attribute from folders
* Supporting localized tag titles
* Using Username as default value for full names when editing users
+ * Snapshot/Factory Reset is possible even with a broken config
* FIX: Fixed missing folders in "move to" dropdown fields
* FIX: Fixed "move to target folders" after CSV import
* FIX: Fixed problem with duplicate extra_buttons when using the i18n of multiisite
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 67496bb..3c9f5bb 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -210,10 +210,20 @@ def page_handler():
if not config.may("wato.use"):
raise MKAuthException(_("You are not allowed to use WATO."))
- # Make information about current folder and hosts available
- prepare_folder_info()
-
current_mode = html.var("mode") or "main"
+
+ try:
+ # Make information about current folder and hosts available
+ # To be able to perform a "factory reset" or a snapshot restore
+ # even with a broken config ignore exceptions in this function
+ # when running in "snapshot" mode
+ prepare_folder_info()
+ except:
+ if current_mode == 'snapshot':
+ pass
+ else:
+ raise
+
modeperms, modefunc = modes.get(current_mode, ([], None))
if modefunc == None:
html.header(_("Sorry"), stylesheets=wato_styles)