Browse code

Merge "Stop Neutron advanced service external processes"

Jenkins authored on 2013/12/18 09:04:07
Showing 5 changed files
... ...
@@ -508,6 +508,19 @@ function stop_neutron() {
508 508
         pid=$(ps aux | awk '/neutron-ns-metadata-proxy/ { print $2 }')
509 509
         [ ! -z "$pid" ] && sudo kill -9 $pid
510 510
     fi
511
+
512
+    if is_service_enabled q-lbaas; then
513
+        neutron_lbaas_stop
514
+    fi
515
+    if is_service_enabled q-fwaas; then
516
+        neutron_fwaas_stop
517
+    fi
518
+    if is_service_enabled q-vpn; then
519
+        neutron_vpn_stop
520
+    fi
521
+    if is_service_enabled q-metering; then
522
+        neutron_metering_stop
523
+    fi
511 524
 }
512 525
 
513 526
 # cleanup_neutron() - Remove residual data files, anything left over from previous
... ...
@@ -518,7 +531,7 @@ function cleanup_neutron() {
518 518
     fi
519 519
 
520 520
     # delete all namespaces created by neutron
521
-    for ns in $(sudo ip netns list | grep -o -e qdhcp-[0-9a-f\-]* -e qrouter-[0-9a-f\-]*); do
521
+    for ns in $(sudo ip netns list | grep -o -E '(qdhcp|qrouter|qlbaas)-[0-9a-f-]*'); do
522 522
         sudo ip netns delete ${ns}
523 523
     done
524 524
 }
... ...
@@ -23,5 +23,9 @@ function neutron_fwaas_configure_driver() {
23 23
     iniset_multiline $FWAAS_DRIVER_CONF_FILENAME fwaas driver "neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver"
24 24
 }
25 25
 
26
+function neutron_fwaas_stop() {
27
+    :
28
+}
29
+
26 30
 # Restore xtrace
27 31
 $MY_XTRACE
... ...
@@ -45,5 +45,10 @@ function neutron_agent_lbaas_configure_agent() {
45 45
     fi
46 46
 }
47 47
 
48
+function neutron_lbaas_stop() {
49
+    pids=$(ps aux | awk '/haproxy/ { print $2 }')
50
+    [ ! -z "$pids" ] && sudo kill $pids
51
+}
52
+
48 53
 # Restore xtrace
49 54
 $MY_XTRACE
... ...
@@ -26,5 +26,9 @@ function neutron_agent_metering_configure_agent() {
26 26
     cp $NEUTRON_DIR/etc/metering_agent.ini $METERING_AGENT_CONF_FILENAME
27 27
 }
28 28
 
29
+function neutron_metering_stop() {
30
+    :
31
+}
32
+
29 33
 # Restore xtrace
30 34
 $MY_XTRACE
... ...
@@ -22,5 +22,16 @@ function neutron_vpn_configure_common() {
22 22
     fi
23 23
 }
24 24
 
25
+function neutron_vpn_stop() {
26
+    local ipsec_data_dir=$DATA_DIR/neutron/ipsec
27
+    local pids
28
+    if [ -d $ipsec_data_dir ]; then
29
+        pids=$(find $ipsec_data_dir -name 'pluto.pid' -exec cat {} \;)
30
+    fi
31
+    if [ -n "$pids" ]; then
32
+        sudo kill $pids
33
+    fi
34
+}
35
+
25 36
 # Restore xtrace
26 37
 $MY_XTRACE