summaryrefslogtreecommitdiffstats
path: root/src/com.gluster.storage.management.gateway.scripts
diff options
context:
space:
mode:
authorBala.FA <bala@gluster.com>2011-09-22 14:16:58 +0530
committerTim <timothyasir@gluster.com>2011-09-23 13:58:03 +0530
commitadae8ca0e2d2a7a628c070ad420d6054f6dab77c (patch)
tree27e6b3d52d3e54edd920f5d795f8b50e18207378 /src/com.gluster.storage.management.gateway.scripts
parentd9edbf72f8a626e901cf877ea95da3c5d7bd5a22 (diff)
Cleanup in VolumeUtils.py
Signed-off-by: Bala.FA <bala@gluster.com>
Diffstat (limited to 'src/com.gluster.storage.management.gateway.scripts')
-rw-r--r--src/com.gluster.storage.management.gateway.scripts/src/backend/VolumeUtils.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/com.gluster.storage.management.gateway.scripts/src/backend/VolumeUtils.py b/src/com.gluster.storage.management.gateway.scripts/src/backend/VolumeUtils.py
index e5256178..5476e090 100644
--- a/src/com.gluster.storage.management.gateway.scripts/src/backend/VolumeUtils.py
+++ b/src/com.gluster.storage.management.gateway.scripts/src/backend/VolumeUtils.py
@@ -16,17 +16,13 @@ import Utils
def readVolumeSmbConfFile(fileName=Globals.VOLUME_SMBCONF_FILE):
entryList = []
- try:
- fp = open(fileName)
- for line in fp:
- tokens = line.split("#")[0].strip().split(";")[0].strip().split("=")
- if len(tokens) != 2:
- continue
- if tokens[0].strip().upper() == "INCLUDE":
- entryList.append(tokens[1].strip())
- fp.close()
- except IOError, e:
- Utils.log("Failed to open file %s: %s" % (fileName, str(e)))
+ lines = Utils.readFile(fileName, lines=True)
+ for line in lines:
+ tokens = line.split("#")[0].strip().split(";")[0].strip().split("=")
+ if len(tokens) != 2:
+ continue
+ if tokens[0].strip().upper() == "INCLUDE":
+ entryList.append(tokens[1].strip())
return entryList