]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Refactoring devstack script
authorHirofumi Ichihara <ichihara.hirofumi@lab.ntt.co.jp>
Thu, 10 Sep 2015 07:54:31 +0000 (16:54 +0900)
committerHirofumi Ichihara <ichihara.hirofumi@lab.ntt.co.jp>
Sun, 20 Sep 2015 15:02:00 +0000 (00:02 +0900)
Change-Id: Iabb7313b667ef6921acbb65b1eb583603b4d0b11

devstack/plugin.sh

index 280489a516926431fb54a1e72b45e81a840214dd..d652698a7f7ee893892358ee6ec5ea88105e746c 100644 (file)
@@ -5,36 +5,35 @@ source $LIBDIR/l2_agent_sriovnicswitch
 source $LIBDIR/ml2
 source $LIBDIR/qos
 
-
-if [[ "$1" == "stack" && "$2" == "install" ]]; then
-    if is_service_enabled q-qos; then
-        configure_qos
-    fi
-fi
-
-if [[ "$1" == "stack" && "$2" == "post-config" ]]; then
-    if is_service_enabled q-agt; then
-        configure_l2_agent
-    fi
-    #Note: sriov agent should run with OVS or linux bridge agent
-    #because they are the mechanisms that bind the DHCP and router ports.
-    #Currently devstack lacks the option to run two agents on the same node.
-    #Therefore we create new service, q-sriov-agt, and the q-agt should be OVS
-    #or linux bridge.
-    if is_service_enabled q-sriov-agt; then
-        configure_$Q_PLUGIN
-        configure_l2_agent
-        configure_l2_agent_sriovnicswitch
-    fi
-fi
-
-if [[ "$1" == "stack" && "$2" == "extra" ]]; then
-    if is_service_enabled q-sriov-agt; then
-        start_l2_agent_sriov
-    fi
-fi
-
-if [[ "$1" == "unstack" ]]; then
+if [[ "$1" == "stack" ]]; then
+    case "$2" in
+        install)
+            if is_service_enabled q-qos; then
+                configure_qos
+            fi
+            ;;
+        post-config)
+            if is_service_enabled q-agt; then
+                configure_l2_agent
+            fi
+            #Note: sriov agent should run with OVS or linux bridge agent
+            #because they are the mechanisms that bind the DHCP and router ports.
+            #Currently devstack lacks the option to run two agents on the same node.
+            #Therefore we create new service, q-sriov-agt, and the q-agt should be OVS
+            #or linux bridge.
+            if is_service_enabled q-sriov-agt; then
+                configure_$Q_PLUGIN
+                configure_l2_agent
+                configure_l2_agent_sriovnicswitch
+            fi
+            ;;
+        extra)
+            if is_service_enabled q-sriov-agt; then
+                start_l2_agent_sriov
+            fi
+            ;;
+    esac
+elif [[ "$1" == "unstack" ]]; then
     if is_service_enabled q-sriov-agt; then
         stop_l2_agent_sriov
     fi