Module: check_mk
Branch: master
Commit: bb31b3243b47f0eec60ed6ab9a4b5f20fc0480e5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bb31b3243b47f0…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat May 25 13:55:59 2013 +0200
Fix exception when restoring after invalid config
---
modules/check_mk.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index e7ef9ee..bd107ce 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -4188,7 +4188,8 @@ def do_restart(only_reload = False):
do_create_config()
except Exception, e:
sys.stderr.write("Error creating configuration: %s\n" % e)
- os.rename(backup_path, nagios_objects_file)
+ if backup_path:
+ os.rename(backup_path, nagios_objects_file)
if opt_debug:
raise
sys.exit(1)