summaryrefslogtreecommitdiffstats
path: root/extras/hook-scripts/S40ufo-stop.py
diff options
context:
space:
mode:
authorMohammed Junaid <junaid@redhat.com>2013-01-23 10:03:07 +0530
committerAnand Avati <avati@redhat.com>2013-02-07 14:02:19 -0800
commit6a6ec980421a115a379aed97364817c16ce7b378 (patch)
tree5bca0b3cb8fcf771229e97c10fc27c813d884678 /extras/hook-scripts/S40ufo-stop.py
parentdc2da4a3d9629fe3249fe540e22748527ce05483 (diff)
object-storage: Store the lock file in /var/run/swift.
* Openstack swift uses the /var/run/swift directory to store the pid files for all the servers. * Also, added a script that would unmount the gluster client on a volume stop. Change-Id: Ib5b9a2964987ca7696d9a2570f1f7af8490b2168 BUG: 861497 Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.org/4417 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'extras/hook-scripts/S40ufo-stop.py')
-rwxr-xr-xextras/hook-scripts/S40ufo-stop.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/extras/hook-scripts/S40ufo-stop.py b/extras/hook-scripts/S40ufo-stop.py
new file mode 100755
index 00000000000..107f1968355
--- /dev/null
+++ b/extras/hook-scripts/S40ufo-stop.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+import os
+from optparse import OptionParser
+
+if __name__ == '__main__':
+ # check if swift is installed
+ try:
+ from gluster.swift.common.Glusterfs import get_mnt_point, unmount
+ except ImportError:
+ import sys
+ sys.exit("Openstack Swift does not appear to be installed properly");
+
+ op = OptionParser(usage="%prog [options...]")
+ op.add_option('--volname', dest='vol', type=str)
+ op.add_option('--last', dest='last', type=str)
+ (opts, args) = op.parse_args()
+
+
+ mnt_point = get_mnt_point(opts.vol)
+ if mnt_point:
+ unmount(mnt_point)
+ else:
+ sys.exit("get_mnt_point returned none for mount point")