summaryrefslogtreecommitdiffstats
path: root/src/com.gluster.storage.management.gateway/WebContent/scripts/get_volume_user_cifs.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/com.gluster.storage.management.gateway/WebContent/scripts/get_volume_user_cifs.py')
-rwxr-xr-xsrc/com.gluster.storage.management.gateway/WebContent/scripts/get_volume_user_cifs.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/get_volume_user_cifs.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/get_volume_user_cifs.py
index 33de3bf1..c385633e 100755
--- a/src/com.gluster.storage.management.gateway/WebContent/scripts/get_volume_user_cifs.py
+++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/get_volume_user_cifs.py
@@ -11,12 +11,10 @@ if not p1 in sys.path:
sys.path.append(p1)
if not p2 in sys.path:
sys.path.append(p2)
+import Globals
import Utils
-cifsVolumeFile = "/opt/glustermg/etc/volumes.cifs"
-
-
def main():
if len(sys.argv) < 2:
sys.stderr.write("usage: %s VOLUME_NAME\n" % os.path.basename(sys.argv[0]))
@@ -24,11 +22,11 @@ def main():
volumeName = sys.argv[1]
- if not os.path.exists(cifsVolumeFile):
+ if not os.path.exists(Globals.CIFS_VOLUME_FILE):
sys.exit(0)
try:
- fp = open(cifsVolumeFile)
+ fp = open(Globals.CIFS_VOLUME_FILE)
content = fp.read()
fp.close()
for line in content.split():
@@ -39,8 +37,8 @@ def main():
# given volume is not configured for cifs export
sys.exit(0)
except IOError, e:
- Utils.log("failed to read file %s: %s" % (cifsVolumeFile, str(e)))
- sys.stderr.write("Failed to read cifs-volume-file %s: %s\n" % (cifsVolumeFile, str(e)))
+ Utils.log("failed to read file %s: %s" % (Globals.CIFS_VOLUME_FILE, str(e)))
+ sys.stderr.write("Failed to read cifs-volume-file %s: %s\n" % (Globals.CIFS_VOLUME_FILE, str(e)))
sys.exit(2)