summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-swift/swift.init
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-swift/swift.init')
-rw-r--r--meta-openstack/recipes-devtools/python/python-swift/swift.init29
1 files changed, 28 insertions, 1 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-swift/swift.init b/meta-openstack/recipes-devtools/python/python-swift/swift.init
index cf12066..256e1d0 100644
--- a/meta-openstack/recipes-devtools/python/python-swift/swift.init
+++ b/meta-openstack/recipes-devtools/python/python-swift/swift.init
@@ -50,6 +50,30 @@ status ()
50 $SWIFT_INIT object-server status 50 $SWIFT_INIT object-server status
51} 51}
52 52
53reset()
54{
55 stop
56
57 CLUSTER_CONF=/etc/swift/cluster.conf
58 SWIFT_SETUP='/bin/bash /etc/swift/swift_setup.sh'
59
60 $SWIFT_SETUP clean
61
62 for i in `seq 1 3`; do
63 BACKING_FILE=/etc/swift/swift_backing_$i
64 if [ "x%SWIFT_BACKING_FILE_SIZE%" != "x0G" ]; then
65 truncate -s %SWIFT_BACKING_FILE_SIZE% $BACKING_FILE
66 fi
67 done
68
69 $SWIFT_SETUP createrings
70 $SWIFT_SETUP formatdevs
71 $SWIFT_SETUP mountdevs
72 $SWIFT_SETUP -i "%CONTROLLER_IP%" adddevs
73 $SWIFT_SETUP unmountdevs
74
75 start
76}
53 77
54case "$1" in 78case "$1" in
55 start) 79 start)
@@ -65,8 +89,11 @@ case "$1" in
65 status) 89 status)
66 status 90 status
67 ;; 91 ;;
92 reset)
93 reset
94 ;;
68 *) 95 *)
69 echo "Usage: swift {start|stop|force-reload|restart|status}" 96 echo "Usage: swift {start|stop|force-reload|restart|status|reset}"
70 exit 1 97 exit 1
71 ;; 98 ;;
72esac 99esac