]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
heat tools : openstack script add restart option
authorSteven Hardy <shardy@redhat.com>
Thu, 5 Jul 2012 15:57:20 +0000 (16:57 +0100)
committerSteven Hardy <shardy@redhat.com>
Thu, 5 Jul 2012 17:08:40 +0000 (18:08 +0100)
Add option to restart openstack

Change-Id: I7578ff4cecae5351d5749272424d71b56071239d
Signed-off-by: Steven Hardy <shardy@redhat.com>
tools/openstack

index 59beb93bbe4921cdc378c7aad02bc428d3585e90..00920f75a30dec73ef51383dc9bec9014b42df27 100755 (executable)
@@ -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 $*