Module: check_mk
Branch: master
Commit: 1cf16d6f1a25c273d836d4338fe2c27c9c84e946
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1cf16d6f1a25c2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 5 11:27:45 2016 +0100
4084 FIX Improved error handling in case of broken hosts.mk files
---
.werks/4084 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/watolib.py | 4 ++--
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/.werks/4084 b/.werks/4084
new file mode 100644
index 0000000..061f4fb
--- /dev/null
+++ b/.werks/4084
@@ -0,0 +1,9 @@
+Title: Improved error handling in case of broken hosts.mk files
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.4.0i3
+Date: 1480933648
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 45b447f..55f38d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -78,6 +78,7 @@
* 4077 FIX: Fixed "Request URI too long" when cloning role after editing
another one
* 4079 FIX: Improved error handling in case a WATO folder can not be written
* 4082 FIX: Icon selector: Fixed exception in case non images are saved in icon
folder
+ * 4084 FIX: Improved error handling in case of broken hosts.mk files
Notifications:
* 4042 FIX: Fix missing From address in synchronous SMTP notifications...
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 068222a..3672778 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -914,8 +914,7 @@ class Folder(BaseFolder):
"service_contactgroups" : [],
"_lock" : False,
}
- execfile(self.hosts_file_path(), variables, variables)
- return variables
+ return store.load_mk_file(self.hosts_file_path(), variables)
def save_hosts(self):
@@ -926,6 +925,7 @@ class Folder(BaseFolder):
call_hook_hosts_changed(self)
+ # TODO: Use the store functions here!
def _save_hosts_file(self):
self._ensure_folder_directory()
if not self.has_hosts():