summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-nova/nova.init
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-nova/nova.init')
-rw-r--r--meta-openstack/recipes-devtools/python/python-nova/nova.init29
1 files changed, 28 insertions, 1 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova.init b/meta-openstack/recipes-devtools/python/python-nova/nova.init
index 87e72fa..46b28d3 100644
--- a/meta-openstack/recipes-devtools/python/python-nova/nova.init
+++ b/meta-openstack/recipes-devtools/python/python-nova/nova.init
@@ -86,6 +86,30 @@ status()
86 echo "$DESC is not running" 86 echo "$DESC is not running"
87} 87}
88 88
89reset()
90{
91 . /etc/nova/openrc
92
93 # Nova comute
94 simple_delete "nova list --all-tenant" "nova delete" 1 "vm"
95
96 stop
97
98 # This is to make sure postgres is configured and running
99 if ! pidof postmaster > /dev/null; then
100 /etc/init.d/postgresql-init
101 /etc/init.d/postgresql start
102 sleep 5
103 fi
104
105 sudo -u postgres dropdb nova
106 sudo -u postgres createdb nova
107 sleep 2
108 nova-manage db sync
109
110 start
111}
112
89case "$1" in 113case "$1" in
90 start) 114 start)
91 start 115 start
@@ -100,8 +124,11 @@ case "$1" in
100 status) 124 status)
101 status 125 status
102 ;; 126 ;;
127 reset)
128 reset
129 ;;
103 *) 130 *)
104 echo "Usage: $0 {start|stop|force-reload|restart|reload|status}" 131 echo "Usage: $0 {start|stop|force-reload|restart|reload|status|reset}"
105 exit 1 132 exit 1
106 ;; 133 ;;
107esac 134esac