Module: check_mk
Branch: master
Commit: 0e697db8fd50b2cc19757285a24935a747f8c4f8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0e697db8fd50b2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 1 10:15:32 2016 +0100
4079 FIX Improved error handling in case a WATO folder can not be written
---
.werks/4079 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/watolib.py | 10 +++++++++-
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/.werks/4079 b/.werks/4079
new file mode 100644
index 0000000..ffa3d12
--- /dev/null
+++ b/.werks/4079
@@ -0,0 +1,10 @@
+Title: Improved error handling in case a WATO folder can not be written
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i3
+Date: 1480583719
+
+
diff --git a/ChangeLog b/ChangeLog
index f5492e3..dbed8c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -69,6 +69,7 @@
* 3992 FIX: netapp_api_connection: fixed GUI display bug when editing rules
* 4076 FIX: Git integration: Using mail address of user in author info
* 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
Notifications:
* 4042 FIX: Fix missing From address in synchronous SMTP notifications...
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 4677b47..08beb23 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -1132,7 +1132,15 @@ class Folder(BaseFolder):
"lock" : self._locked,
"lock_subfolders" : self._locked_subfolders,
}
- file(self.wato_info_path(), "w").write("%r\n" % wato_info)
+ try:
+ file(self.wato_info_path(), "w").write("%r\n" %
wato_info)
+ except IOError, e:
+ if e.errno == 13: # Permission denied
+ raise MKGeneralException(_("Failed to write to the WATO folder
'%s': %s. "
+ "Please check the filesystems permissions
of this "
+ "folder.") % (self.title(), e))
+ else:
+ raise
def _ensure_folder_directory(self):