summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-glance/glance.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-glance/glance.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-glance/glance.init')
-rw-r--r--meta-openstack/recipes-devtools/python/python-glance/glance.init29
1 files changed, 28 insertions, 1 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-glance/glance.init b/meta-openstack/recipes-devtools/python/python-glance/glance.init
index cb94ed7..5b1bf74 100644
--- a/meta-openstack/recipes-devtools/python/python-glance/glance.init
+++ b/meta-openstack/recipes-devtools/python/python-glance/glance.init
@@ -70,6 +70,30 @@ status()
70 echo "$DESC is not running" 70 echo "$DESC is not running"
71} 71}
72 72
73reset()
74{
75 . /etc/nova/openrc
76
77 # Cleanup all glance images
78 simple_delete "glance image-list --all-tenant" "glance image-delete" 1 "glance image"
79
80 stop
81
82 # This is to make sure postgres is configured and running
83 if ! pidof postmaster > /dev/null; then
84 /etc/init.d/postgresql-init
85 /etc/init.d/postgresql start
86 sleep 5
87 fi
88
89 [ ! -d /var/log/glance ] && mkdir /var/log/glance
90 sudo -u postgres dropdb glance
91 sudo -u postgres createdb glance
92 glance-manage db_sync
93
94 start
95}
96
73case "$1" in 97case "$1" in
74 start) 98 start)
75 start 99 start
@@ -84,8 +108,11 @@ case "$1" in
84 status) 108 status)
85 status 109 status
86 ;; 110 ;;
111 reset)
112 reset
113 ;;
87 *) 114 *)
88 echo "Usage: $0 {start|stop|force-reload|restart|reload|status}" 115 echo "Usage: $0 {start|stop|force-reload|restart|reload|status|reset}"
89 exit 1 116 exit 1
90 ;; 117 ;;
91esac 118esac