diff options
| author | Shireesh Anjal <anjalshireesh@gmail.com> | 2011-08-10 03:53:21 -0700 |
|---|---|---|
| committer | Shireesh Anjal <anjalshireesh@gmail.com> | 2011-08-10 03:53:21 -0700 |
| commit | 70bc2e0c2fe1bbac30e4d8d80d83c5095d2bce2c (patch) | |
| tree | bb3bb070f3b1340883303fa272597e1d8cb2f398 /src/com.gluster.storage.management.gateway.scripts | |
| parent | 85084370f0b1f68c60362906638cfa6230946ed8 (diff) | |
| parent | 35b201ea42e07d38d755605a1ef61abaa4d0cc21 (diff) | |
Merge pull request #221 from balamurugana/master
create_volume_cifs.py ignores already existing mount directory and reload samba on success.
Diffstat (limited to 'src/com.gluster.storage.management.gateway.scripts')
| -rwxr-xr-x | src/com.gluster.storage.management.gateway.scripts/src/create_volume_cifs.py | 16 |
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__": |
