From 1491d54da84195dda8c7d5ce1fac21437f2bc519 Mon Sep 17 00:00:00 2001 From: Amy Fong Date: Thu, 24 Jul 2014 13:04:41 -0400 Subject: 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 --- .../python/python-swift/swift.init | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'meta-openstack/recipes-devtools/python/python-swift') 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 () $SWIFT_INIT object-server status } +reset() +{ + stop + + CLUSTER_CONF=/etc/swift/cluster.conf + SWIFT_SETUP='/bin/bash /etc/swift/swift_setup.sh' + + $SWIFT_SETUP clean + + for i in `seq 1 3`; do + BACKING_FILE=/etc/swift/swift_backing_$i + if [ "x%SWIFT_BACKING_FILE_SIZE%" != "x0G" ]; then + truncate -s %SWIFT_BACKING_FILE_SIZE% $BACKING_FILE + fi + done + + $SWIFT_SETUP createrings + $SWIFT_SETUP formatdevs + $SWIFT_SETUP mountdevs + $SWIFT_SETUP -i "%CONTROLLER_IP%" adddevs + $SWIFT_SETUP unmountdevs + + start +} case "$1" in start) @@ -65,8 +89,11 @@ case "$1" in status) status ;; + reset) + reset + ;; *) - echo "Usage: swift {start|stop|force-reload|restart|status}" + echo "Usage: swift {start|stop|force-reload|restart|status|reset}" exit 1 ;; esac -- cgit v1.2.3-54-g00ecf