summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBala.FA <bala@gluster.com>2011-08-10 15:48:30 +0530
committerBala.FA <bala@gluster.com>2011-08-10 15:52:34 +0530
commit35b201ea42e07d38d755605a1ef61abaa4d0cc21 (patch)
treebb3bb070f3b1340883303fa272597e1d8cb2f398 /src
parent85084370f0b1f68c60362906638cfa6230946ed8 (diff)
create_volume_cifs.py ignores already existing mount directory and reload samba on success.
Signed-off-by: Bala.FA <bala@gluster.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/com.gluster.storage.management.gateway.scripts/src/create_volume_cifs.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/com.gluster.storage.management.gateway.scripts/src/create_volume_cifs.py b/src/com.gluster.storage.management.gateway.scripts/src/create_volume_cifs.py
index 9da715e6..5a27ab87 100755
--- a/src/com.gluster.storage.management.gateway.scripts/src/create_volume_cifs.py
+++ b/src/com.gluster.storage.management.gateway.scripts/src/create_volume_cifs.py
@@ -25,16 +25,22 @@ def main():
volumeMountDirName = "%s/%s" % (Globals.REEXPORT_DIR, volumeName)
try:
- os.mkdir(volumeMountDirName)
+ if not os.path.exists(volumeMountDirName):
+ os.mkdir(volumeMountDirName)
except OSError, e:
Utils.log("failed creating %s: %s\n" % (volumeMountDirName, str(e)))
sys.stderr.write("Failed creating %s: %s\n" % (volumeMountDirName, str(e)))
sys.exit(1)
- if VolumeUtils.writeVolumeCifsConfiguration(volumeName, userList):
- sys.exit(0)
- sys.stderr.write("Unable to write volume cifs configuration\n")
- sys.exit(2)
+ if not VolumeUtils.writeVolumeCifsConfiguration(volumeName, userList):
+ sys.stderr.write("Failed to write volume cifs configuration\n")
+ sys.exit(2)
+
+ if Utils.runCommand("service smb reload") != 0:
+ Utils.log("Failed to reload smb service")
+ sys.stderr.write("Failed to reload smb service\n")
+ sys.exit(3)
+ sys.exit(0)
if __name__ == "__main__":