From ccaad827b2bdcdcf4b538c5d5367f14cfc22c08f Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Fri, 20 Jun 2014 14:59:49 +1200 Subject: [PATCH] Revert "ovs-agent: Ensure integration bridge is created" This reverts commit e5cdad90f97d3a54a493eca19e7a3ff643426de1. TripleO's multi-node testing shows that this patch caused a failure to receive tunnel updates, leading to the first node up to have no agent ports, the second to have one agent port, the third to have 2 agent ports, etc. Needless to say, this doesn't work all that well :) Change-Id: Ie90dd4d113a404948dd5debad48065b7db48faa5 Closes-Bug: #1292105 --- neutron/plugins/openvswitch/agent/ovs_neutron_agent.py | 8 +------- neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py | 2 -- neutron/tests/unit/openvswitch/test_ovs_tunnel.py | 7 +++---- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py b/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py index e6a58567a41..a8155352195 100644 --- a/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py +++ b/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py @@ -179,11 +179,11 @@ class OVSNeutronAgent(rpc_compat.RpcCallback, self.int_br_device_count = 0 self.int_br = ovs_lib.OVSBridge(integ_br, self.root_helper) - self.setup_integration_br() self.int_br.set_secure_mode() # Stores port update notifications for processing in main rpc loop self.updated_ports = set() self.setup_rpc() + self.setup_integration_br() self.bridge_mappings = bridge_mappings self.setup_physical_bridges(self.bridge_mappings) self.local_vlan_map = {} @@ -733,12 +733,6 @@ class OVSNeutronAgent(rpc_compat.RpcCallback, :param bridge_name: the name of the integration bridge. :returns: the integration bridge ''' - # Ensure the integration bridge is created. - # ovs_lib.OVSBridge.create() will run - # ovs-vsctl -- --may-exist add-br BRIDGE_NAME - # which does nothing if bridge already exists. - self.int_br.create() - self.int_br.delete_port(cfg.CONF.OVS.int_peer_patch_port) self.int_br.remove_all_flows() # switch all traffic using L2 learning diff --git a/neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py b/neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py index b8eb761a98b..b1d2371b3b1 100644 --- a/neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py +++ b/neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py @@ -118,8 +118,6 @@ class TestOvsNeutronAgent(base.BaseTestCase): mock.patch('neutron.plugins.openvswitch.agent.ovs_neutron_agent.' 'OVSNeutronAgent.setup_ancillary_bridges', return_value=[]), - mock.patch('neutron.agent.linux.ovs_lib.OVSBridge.' - 'create'), mock.patch('neutron.agent.linux.ovs_lib.OVSBridge.' 'set_secure_mode'), mock.patch('neutron.agent.linux.ovs_lib.OVSBridge.' diff --git a/neutron/tests/unit/openvswitch/test_ovs_tunnel.py b/neutron/tests/unit/openvswitch/test_ovs_tunnel.py index 59fdd28d830..642659037b5 100644 --- a/neutron/tests/unit/openvswitch/test_ovs_tunnel.py +++ b/neutron/tests/unit/openvswitch/test_ovs_tunnel.py @@ -107,14 +107,13 @@ class TunnelTest(base.BaseTestCase): self.mock_int_bridge = self.ovs_bridges[self.INT_BRIDGE] self.mock_int_bridge.get_local_port_mac.return_value = '000000000001' self.mock_int_bridge_expected = [ - mock.call.create(), + mock.call.set_secure_mode(), + mock.call.get_local_port_mac(), mock.call.delete_port('patch-tun'), mock.call.remove_all_flows(), mock.call.add_flow(priority=1, actions='normal'), mock.call.add_flow(priority=0, table=constants.CANARY_TABLE, - actions='drop'), - mock.call.set_secure_mode(), - mock.call.get_local_port_mac() + actions='drop') ] self.mock_map_tun_bridge = self.ovs_bridges[self.MAP_TUN_BRIDGE]