summaryrefslogtreecommitdiffstats
path: root/src/com.gluster.storage.management.gateway.scripts/src/backend
diff options
context:
space:
mode:
authorBala.FA <bala@gluster.com>2011-09-22 14:00:10 +0530
committerTim <timothyasir@gluster.com>2011-09-23 13:58:02 +0530
commiteff53560aeed0e1180188d7d51b78c9de7c77daf (patch)
tree08f81b54c1fb3692b25f74e4d99c4c8ef2b06860 /src/com.gluster.storage.management.gateway.scripts/src/backend
parent30b6833af799f16668de3c8721f69fd8a291e2f9 (diff)
Cleanup in FsTabUtils.py
Signed-off-by: Bala.FA <bala@gluster.com>
Diffstat (limited to 'src/com.gluster.storage.management.gateway.scripts/src/backend')
-rw-r--r--src/com.gluster.storage.management.gateway.scripts/src/backend/FsTabUtils.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/com.gluster.storage.management.gateway.scripts/src/backend/FsTabUtils.py b/src/com.gluster.storage.management.gateway.scripts/src/backend/FsTabUtils.py
index 368b7a15..653d0dda 100644
--- a/src/com.gluster.storage.management.gateway.scripts/src/backend/FsTabUtils.py
+++ b/src/com.gluster.storage.management.gateway.scripts/src/backend/FsTabUtils.py
@@ -11,17 +11,14 @@ if not p1 in sys.path:
sys.path.append(p1)
if not p2 in sys.path:
sys.path.append(p2)
+import Utils
import Globals
def readFsTab(fsTabFile=Globals.FSTAB_FILE):
- try:
- fsTabfp = open(fsTabFile)
- except IOError, e:
- log("readFsTab(): " + str(e))
- return None
+ lines = Utils.readFile(fsTabFile)
fsTabEntryList = []
- for line in fsTabfp:
+ for line in lines:
tokens = line.strip().split()
if not tokens or tokens[0].startswith('#'):
continue
@@ -43,8 +40,6 @@ def readFsTab(fsTabFile=Globals.FSTAB_FILE):
pass
if fsTabEntry["Device"] and fsTabEntry["MountPoint"] and fsTabEntry["FsType"] and fsTabEntry["Options"]:
fsTabEntryList.append(fsTabEntry)
-
- fsTabfp.close()
return fsTabEntryList
def writeFsTab(fsTabEntryList, fsTabFile=Globals.FSTAB_FILE):