Browse code

Revert "Support for single interface Neutron networking with OVS"

This patch is causing blocking failures in some 3rd party CIs.
The issue can be tracked to the fact that the PUBLIC_INTERFACE
interface might have no address assigned.

This reverts commit 93b2100c983e1c271a8d51aa7f4755a6445be6a8.

Partial-Bug: #1436607
Change-Id: I0943aa542b911fbcebb100543e0adbb38159b233

Alessandro Pilotti authored on 2015/03/26 08:14:05
Showing 1 changed files
... ...
@@ -779,41 +779,9 @@ function stop_neutron {
779 779
     fi
780 780
 }
781 781
 
782
-# _move_neutron_addresses_route() - Move the primary IP to the OVS bridge
783
-# on startup, or back to the public interface on cleanup
784
-function _move_neutron_addresses_route {
785
-    local from_intf=$1
786
-    local to_intf=$2
787
-    local add_ovs_port=$3
788
-
789
-    if [[ -n "$from_intf" && -n "$to_intf" ]]; then
790
-        # Remove the primary IP address from $from_intf and add it to $to_intf,
791
-        # along with the default route, if it exists.  Also, when called
792
-        # on configure we will also add $from_intf as a port on $to_intf,
793
-        # assuming it is an OVS bridge.
794
-
795
-        local IP_BRD=$(ip -4 a s dev $from_intf | awk '/inet/ { print $2, $3, $4; exit }')
796
-        local DEFAULT_ROUTE_GW=$(ip r | awk "/default.+$from_intf/ { print \$3; exit }")
797
-        local ADD_OVS_PORT=""
798
-
799
-        if [ "$DEFAULT_ROUTE_GW" != "" ]; then
800
-            ADD_DEFAULT_ROUTE="sudo ip r replace default via $DEFAULT_ROUTE_GW dev $to_intf"
801
-        fi
802
-
803
-        if [[ "$add_ovs_port" == "True" ]]; then
804
-            ADD_OVS_PORT="sudo ovs-vsctl add-port $to_intf $from_intf"
805
-        fi
806
-
807
-        sudo ip addr del $IP_BRD dev $from_intf; sudo ip addr add $IP_BRD dev $to_intf; $ADD_OVS_PORT; $ADD_DEFAULT_ROUTE
808
-    fi
809
-}
810
-
811 782
 # cleanup_neutron() - Remove residual data files, anything left over from previous
812 783
 # runs that a clean run would need to clean up
813 784
 function cleanup_neutron {
814
-
815
-    _move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False
816
-
817 785
     if is_provider_network && is_ironic_hardware; then
818 786
         for IP in $(ip addr show dev $OVS_PHYSICAL_BRIDGE | grep ' inet ' | awk '{print $2}'); do
819 787
             sudo ip addr del $IP dev $OVS_PHYSICAL_BRIDGE
... ...
@@ -988,8 +956,6 @@ function _configure_neutron_l3_agent {
988 988
     _neutron_setup_interface_driver $Q_L3_CONF_FILE
989 989
 
990 990
     neutron_plugin_configure_l3_agent
991
-
992
-    _move_neutron_addresses_route "$PUBLIC_INTERFACE" "$OVS_PHYSICAL_BRIDGE" True
993 991
 }
994 992
 
995 993
 function _configure_neutron_metadata_agent {
... ...
@@ -1261,10 +1227,8 @@ function _neutron_configure_router_v4 {
1261 1261
         if is_neutron_ovs_base_plugin && [[ "$Q_USE_NAMESPACE" = "True" ]]; then
1262 1262
             local ext_gw_interface=$(_neutron_get_ext_gw_interface)
1263 1263
             local cidr_len=${FLOATING_RANGE#*/}
1264
-            if [[ $(ip addr show dev $ext_gw_interface | grep -c $ext_gw_ip) == 0 && $Q_USE_PROVIDERNET_FOR_PUBLIC == "False" ]]; then
1265
-                sudo ip addr add $ext_gw_ip/$cidr_len dev $ext_gw_interface
1266
-                sudo ip link set $ext_gw_interface up
1267
-            fi
1264
+            sudo ip addr add $ext_gw_ip/$cidr_len dev $ext_gw_interface
1265
+            sudo ip link set $ext_gw_interface up
1268 1266
             ROUTER_GW_IP=`neutron port-list -c fixed_ips -c device_owner | grep router_gateway | awk -F '"' -v subnet_id=$PUB_SUBNET_ID '$4 == subnet_id { print $8; }'`
1269 1267
             die_if_not_set $LINENO ROUTER_GW_IP "Failure retrieving ROUTER_GW_IP"
1270 1268
             sudo route add -net $FIXED_RANGE gw $ROUTER_GW_IP