diff options
author | Bala.FA <bala@gluster.com> | 2011-09-22 13:46:45 +0530 |
---|---|---|
committer | Tim <timothyasir@gluster.com> | 2011-09-23 13:58:02 +0530 |
commit | 30b6833af799f16668de3c8721f69fd8a291e2f9 (patch) | |
tree | 8e07a07c5e99e51543671935f972b3deda369b7b | |
parent | ad1e62e81af9a102d9a190300cb8b314c3f8aea8 (diff) |
Cleanup in DiskUtils.py
Signed-off-by: Bala.FA <bala@gluster.com>
-rw-r--r-- | src/com.gluster.storage.management.gateway.scripts/src/backend/DiskUtils.py | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/src/com.gluster.storage.management.gateway.scripts/src/backend/DiskUtils.py b/src/com.gluster.storage.management.gateway.scripts/src/backend/DiskUtils.py index bfa9c575..9eb065a0 100644 --- a/src/com.gluster.storage.management.gateway.scripts/src/backend/DiskUtils.py +++ b/src/com.gluster.storage.management.gateway.scripts/src/backend/DiskUtils.py @@ -188,32 +188,10 @@ def getDiskList(diskDeviceList=None): return diskInfo["disks"] -def checkDiskMountPoint(diskMountPoint): - try: - fstabEntries = open(Globals.FSTAB_FILE).readlines() - except IOError, e: - fstabEntries = [] - Utils.log("failed to read file %s: %s" % (Globals.FSTAB_FILE, str(e))) - found = False - for entry in fstabEntries: - entry = entry.strip() - if not entry: - continue - entries = entry.split() - if entries and len(entries) > 1 and entries[0].startswith("UUID=") and entries[1].upper() == diskMountPoint.upper(): - return True - return False - - def getMountPointByUuid(partitionUuid): - # check uuid in etc/fstab - try: - fstabEntries = open(Globals.FSTAB_FILE).readlines() - except IOError, e: - fstabEntries = [] - Utils.log("failed to read file %s: %s" % (Globals.FSTAB_FILE, str(e))) + lines = Utils.readFile(Globals.FSTAB_FILE, lines=True) found = False - for entry in fstabEntries: + for entry in lines: entry = entry.strip() if not entry: continue |