From ed71fe29081c59d2ff73f27271aa909640a7b7aa Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Thu, 5 Jul 2012 16:57:20 +0100 Subject: [PATCH] heat tools : openstack script add restart option Add option to restart openstack Change-Id: I7578ff4cecae5351d5749272424d71b56071239d Signed-off-by: Steven Hardy --- tools/openstack | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/openstack b/tools/openstack index 59beb93b..00920f75 100755 --- a/tools/openstack +++ b/tools/openstack @@ -13,11 +13,12 @@ action=$1 if [ -z "$action" ] then echo "openstack [start|stop|install|erase|status]" - echo "" + echo echo "This tool is designed to control OpenStack on a Fedora 16/17 system" - echo "" + echo echo "start - Starts OpenStack" echo "stop - Stops OpenStack" + echo "restart - Restart OpenStack" echo "install - Installs a fresh OpenStack system with Keystone from RPM repostories" echo "erase - permanently destroys an existing installation of OpenStack" fi @@ -62,6 +63,13 @@ function os_stop() { done } +function os_restart() { + action=restart + os_stop + sleep 1 + os_start +} + function os_erase() { for net in `sudo nova-manage network list | awk '/^[[:digit:]]/ { print $9 }'` @@ -171,6 +179,9 @@ case $action in stop) os_stop ;; + restart) + os_restart + ;; erase) shift os_erase $* -- 2.45.2