summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-swift
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:30 -0400
commit1491d54da84195dda8c7d5ce1fac21437f2bc519 (patch)
treecc16576ec9471de2c9d18de8987f5a046971df0f /meta-openstack/recipes-devtools/python/python-swift
parent3085fa57f54335cfa3794aaf1f45928f5300b000 (diff)
downloadmeta-cloud-services-1491d54da84195dda8c7d5ce1fac21437f2bc519.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')
-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