Module: check_mk
Branch: master
Commit: b6a3507b33bd101edd0efb60afbdc20f77472db9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b6a3507b33bd10…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Feb 21 17:32:06 2012 +0100
Fixed exception when restoring factory settings
---
web/htdocs/wato.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index b50e56e..b629d8b 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -4418,8 +4418,10 @@ def factory_reset():
save_users(users) # this will cleanup htpasswd
for path in [ root_dir, multisite_dir, sites_mk, log_dir ]:
- if os.path.exists(path):
+ if os.path.isdir(path):
shutil.rmtree(path)
+ elif os.path.exists(path):
+ os.remove(path)
log_pending(SYNCRESTART, None, "factory-reset", _("Complete reset to
factory settings."))