Module: check_mk
Branch: master
Commit: 10307e794a1f66eea47a615ecf499df5c48ca444
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=10307e794a1f66…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 24 10:48:33 2017 +0100
4398 FIX Fixed broken GUI when deleting local/share/check_mk/web/plugins dir
An exception "OSError ([Errno 2] No such file or directory:
'/omd/sites/shl/local/share/check_mk/web/plugins/')" prevented use of the GUI
at all when deleting the directory.
Change-Id: I3d4284755aa156695960f0c8751a50cbf2090fa8
---
.werks/4398 | 11 +++++++++++
web/htdocs/lib.py | 11 ++++++++++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/.werks/4398 b/.werks/4398
new file mode 100644
index 0000000..7f50f55
--- /dev/null
+++ b/.werks/4398
@@ -0,0 +1,11 @@
+Title: Fixed broken GUI when deleting local/share/check_mk/web/plugins dir
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1487929499
+
+An exception "OSError ([Errno 2] No such file or directory:
'/omd/sites/shl/local/share/check_mk/web/plugins/')" prevented use of the GUI
at all when deleting the directory.
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index a957ffd..3a702c0 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -190,7 +190,16 @@ def load_web_plugins(forwhat, globalvars):
def find_local_web_plugins():
basedir = cmk.paths.local_web_dir + "/plugins/"
- for plugins_dir in os.listdir(basedir):
+
+ try:
+ plugin_dirs = os.listdir(basedir)
+ except OSError, e:
+ if e.errno == 2:
+ return
+ else:
+ raise
+
+ for plugins_dir in plugin_dirs:
dir_path = basedir + plugins_dir
yield dir_path # Changes in the directory like deletion of files!
if os.path.isdir(dir_path):