From eff53560aeed0e1180188d7d51b78c9de7c77daf Mon Sep 17 00:00:00 2001 From: "Bala.FA" Date: Thu, 22 Sep 2011 14:00:10 +0530 Subject: Cleanup in FsTabUtils.py Signed-off-by: Bala.FA --- .../src/backend/FsTabUtils.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src') 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): -- cgit