diff options
author | Amy Fong <amy.fong@windriver.com> | 2014-07-24 13:04:41 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-07-25 15:45:30 -0400 |
commit | 1491d54da84195dda8c7d5ce1fac21437f2bc519 (patch) | |
tree | cc16576ec9471de2c9d18de8987f5a046971df0f /meta-openstack/recipes-devtools/python/python-swift | |
parent | 3085fa57f54335cfa3794aaf1f45928f5300b000 (diff) | |
download | meta-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.init | 29 |
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 | ||
53 | reset() | ||
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 | ||
54 | case "$1" in | 78 | case "$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 | ;; |
72 | esac | 99 | esac |