summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-glance/glance.init
diff options
context:
space:
mode:
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