[omd-commits] OMD Git: omd: Fixed BUG: Crash whith mounts using whitespaces

git version control git at mathias-kettner.de
Wed Apr 4 14:23:39 CEST 2012


Module:   omd
Branch:   master
Commit:   ed0083645eecc8f32b636e1109a77313838aa9e3
URL:      http://omdistro.org/projects/omd/repository/revisions/ed0083645eecc8f32b636e1109a77313838aa9e3

Author:   Bastian Kuhn <bk at mathias-kettner.de>
Date:     Wed Apr  4 14:23:32 2012 +0200
Commiter: Bastian Kuhn <bk at mathias-kettner.de>
Date:     Wed Apr  4 14:23:32 2012 +0200

Fixed BUG: Crash whith mounts using whitespaces

---

 packages/omd/omd |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/packages/omd/omd b/packages/omd/omd
index 97f372d..b81a47e 100644
--- a/packages/omd/omd
+++ b/packages/omd/omd
@@ -651,9 +651,12 @@ def tmpfs_mounted(sitename):
     # different from tmp_path. We just check the suffix therefore.
     path_suffix = "sites/%s/tmp" % sitename
     for line in file("/proc/mounts"):
-        device, mp, fstype, options, dump, fsck = line.split()
-        if mp.endswith(path_suffix) and fstype == 'tmpfs':
-            return True
+        try:
+            device, mp, fstype, options, dump, fsck = line.split()
+            if mp.endswith(path_suffix) and fstype == 'tmpfs':
+                return True
+        except:
+            continue
     return False
 
 def create_tmpfs(sitename):



More information about the omd-commits mailing list