summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-swift/swift.init
diff options
context:
space:
mode:
authorAmy Fong <amy.fong@windriver.com>2014-07-24 13:04:41 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-07-25 15:45:25 -0400
commit3bbd08214617f5a5e7b54253f9f8b786623546c8 (patch)
treed782a074f3a013b302446817ef9d147ddee6bb60 /meta-openstack/recipes-devtools/python/python-swift/swift.init
parentce99c21125614dfa72428a9ef3ed563db8c99c93 (diff)
downloadmeta-cloud-services-3bbd08214617f5a5e7b54253f9f8b786623546c8.tar.gz
openstack initscript: add reset
Some of the openstack data is associated with external resources (ie glance may have external files), we explicitly invoke the delete commands on those in additional to dropping and recreating the databases. Signed-off-by: Amy Fong <amy.fong@windriver.com>
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