summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-cinder/cinder-volume
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-cinder/cinder-volume
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-cinder/cinder-volume')
-rw-r--r--meta-openstack/recipes-devtools/python/python-cinder/cinder-volume38
1 files changed, 37 insertions, 1 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-cinder/cinder-volume b/meta-openstack/recipes-devtools/python/python-cinder/cinder-volume
index aec6ab0..f753810 100644
--- a/meta-openstack/recipes-devtools/python/python-cinder/cinder-volume
+++ b/meta-openstack/recipes-devtools/python/python-cinder/cinder-volume
@@ -69,6 +69,39 @@ status()
69 echo "$DESC is not running" 69 echo "$DESC is not running"
70} 70}
71 71
72reset()
73{
74 . /etc/nova/openrc
75
76 # Cleanup cinder volume
77 simple_delete "cinder list --all-tenant" "cinder delete" 1 "cinder volume"
78
79 # Cleanup cinder backup
80 simple_delete "cinder backup-list" "cinder backup-delete" 1 "cinder backup"
81
82 stop
83
84 if ! pidof postmaster > /dev/null; then
85 /etc/init.d/postgresql-init
86 /etc/init.d/postgresql start
87 fi
88 [ ! -d /var/log/cinder ] && mkdir /var/log/cinder
89 sudo -u postgres dropdb cinder
90 sudo -u postgres createdb cinder
91 cinder-manage db sync
92
93 if [ ! -f /etc/cinder/nfs_shares ]; then
94 /bin/bash /etc/cinder/drivers/nfs_setup.sh
95 fi
96
97 # Create Cinder glusterfs_share config file with default glusterfs server
98 if [ ! -f /etc/cinder/glusterfs_shares ] && [ -f /usr/sbin/glusterfsd ]; then
99 /bin/bash /etc/cinder/drivers/glusterfs_setup.sh
100 fi
101
102 start
103}
104
72case "$1" in 105case "$1" in
73 start) 106 start)
74 start 107 start
@@ -83,8 +116,11 @@ case "$1" in
83 status) 116 status)
84 status 117 status
85 ;; 118 ;;
119 reset)
120 reset
121 ;;
86 *) 122 *)
87 echo "Usage: $0 {start|stop|force-reload|restart|reload|status}" 123 echo "Usage: $0 {start|stop|force-reload|restart|reload|status|reset}"
88 exit 1 124 exit 1
89 ;; 125 ;;
90esac 126esac