ofagent: Remove obsolete bridge_mappings (plugin side)
For ofagent, it has been superseded by physical_interface_mappings and was planned to be removed in Kilo. Related: blueprint ofagent-physical-interface-mappings Change-Id: I1f7cbcde429a03e7e918dc224d8cbd8c6aa47049
This commit is contained in:
parent
f0233e25a0
commit
8401c81d74
@ -50,16 +50,13 @@ class OfagentMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
|
|||||||
vif_details)
|
vif_details)
|
||||||
|
|
||||||
def check_segment_for_agent(self, segment, agent):
|
def check_segment_for_agent(self, segment, agent):
|
||||||
bridge_mappings = agent['configurations'].get('bridge_mappings', {})
|
|
||||||
interface_mappings = agent['configurations'].get('interface_mappings',
|
interface_mappings = agent['configurations'].get('interface_mappings',
|
||||||
{})
|
{})
|
||||||
tunnel_types = agent['configurations'].get('tunnel_types', [])
|
tunnel_types = agent['configurations'].get('tunnel_types', [])
|
||||||
LOG.debug("Checking segment: %(segment)s "
|
LOG.debug("Checking segment: %(segment)s "
|
||||||
"for bridge_mappings: %(bridge_mappings)s "
|
"for interface_mappings: %(interface_mappings)s "
|
||||||
"and interface_mappings: %(interface_mappings)s "
|
|
||||||
"with tunnel_types: %(tunnel_types)s",
|
"with tunnel_types: %(tunnel_types)s",
|
||||||
{'segment': segment,
|
{'segment': segment,
|
||||||
'bridge_mappings': bridge_mappings,
|
|
||||||
'interface_mappings': interface_mappings,
|
'interface_mappings': interface_mappings,
|
||||||
'tunnel_types': tunnel_types})
|
'tunnel_types': tunnel_types})
|
||||||
network_type = segment[api.NETWORK_TYPE]
|
network_type = segment[api.NETWORK_TYPE]
|
||||||
@ -67,6 +64,5 @@ class OfagentMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
|
|||||||
network_type == p_const.TYPE_LOCAL or
|
network_type == p_const.TYPE_LOCAL or
|
||||||
network_type in tunnel_types or
|
network_type in tunnel_types or
|
||||||
(network_type in [p_const.TYPE_FLAT, p_const.TYPE_VLAN] and
|
(network_type in [p_const.TYPE_FLAT, p_const.TYPE_VLAN] and
|
||||||
(segment[api.PHYSICAL_NETWORK] in bridge_mappings
|
segment[api.PHYSICAL_NETWORK] in interface_mappings)
|
||||||
or segment[api.PHYSICAL_NETWORK] in interface_mappings))
|
|
||||||
)
|
)
|
||||||
|
@ -80,7 +80,7 @@ L2_AGENT_5 = {
|
|||||||
'topic': constants.L2_AGENT_TOPIC,
|
'topic': constants.L2_AGENT_TOPIC,
|
||||||
'configurations': {'tunneling_ip': '20.0.0.5',
|
'configurations': {'tunneling_ip': '20.0.0.5',
|
||||||
'tunnel_types': [],
|
'tunnel_types': [],
|
||||||
'bridge_mappings': {'physnet1': 'br'},
|
'interface_mappings': {'physnet1': 'eth9'},
|
||||||
'l2pop_network_types': ['vlan']},
|
'l2pop_network_types': ['vlan']},
|
||||||
'agent_type': constants.AGENT_TYPE_OFA,
|
'agent_type': constants.AGENT_TYPE_OFA,
|
||||||
'tunnel_type': [],
|
'tunnel_type': [],
|
||||||
@ -799,4 +799,4 @@ class TestL2PopulationRpcTestCase(test_plugin.Ml2PluginV2TestCase):
|
|||||||
'remove_fdb_entries')) as (upd_port_down,
|
'remove_fdb_entries')) as (upd_port_down,
|
||||||
rem_fdb_entries):
|
rem_fdb_entries):
|
||||||
l2pop_mech.delete_port_postcommit(mock.Mock())
|
l2pop_mech.delete_port_postcommit(mock.Mock())
|
||||||
self.assertTrue(upd_port_down.called)
|
self.assertTrue(upd_port_down.called)
|
||||||
|
@ -92,67 +92,3 @@ class OfagentMechanismSGDisabledLocalTestCase(
|
|||||||
OfagentMechanismSGDisabledBaseTestCase,
|
OfagentMechanismSGDisabledBaseTestCase,
|
||||||
base.AgentMechanismLocalTestCase):
|
base.AgentMechanismLocalTestCase):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
# The following tests are for deprecated "bridge_mappings".
|
|
||||||
# TODO(yamamoto): Remove them.
|
|
||||||
|
|
||||||
class OfagentMechanismPhysBridgeTestCase(base.AgentMechanismBaseTestCase):
|
|
||||||
VIF_TYPE = portbindings.VIF_TYPE_OVS
|
|
||||||
VIF_DETAILS = {portbindings.CAP_PORT_FILTER: True,
|
|
||||||
portbindings.OVS_HYBRID_PLUG: True}
|
|
||||||
AGENT_TYPE = constants.AGENT_TYPE_OFA
|
|
||||||
|
|
||||||
GOOD_MAPPINGS = {'fake_physical_network': 'fake_bridge'}
|
|
||||||
GOOD_TUNNEL_TYPES = ['gre', 'vxlan']
|
|
||||||
GOOD_CONFIGS = {'bridge_mappings': GOOD_MAPPINGS,
|
|
||||||
'tunnel_types': GOOD_TUNNEL_TYPES}
|
|
||||||
|
|
||||||
BAD_MAPPINGS = {'wrong_physical_network': 'wrong_bridge'}
|
|
||||||
BAD_TUNNEL_TYPES = ['bad_tunnel_type']
|
|
||||||
BAD_CONFIGS = {'bridge_mappings': BAD_MAPPINGS,
|
|
||||||
'tunnel_types': BAD_TUNNEL_TYPES}
|
|
||||||
|
|
||||||
AGENTS = [{'alive': True,
|
|
||||||
'configurations': GOOD_CONFIGS}]
|
|
||||||
AGENTS_DEAD = [{'alive': False,
|
|
||||||
'configurations': GOOD_CONFIGS}]
|
|
||||||
AGENTS_BAD = [{'alive': False,
|
|
||||||
'configurations': GOOD_CONFIGS},
|
|
||||||
{'alive': True,
|
|
||||||
'configurations': BAD_CONFIGS}]
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(OfagentMechanismPhysBridgeTestCase, self).setUp()
|
|
||||||
self.driver = mech_ofagent.OfagentMechanismDriver()
|
|
||||||
self.driver.initialize()
|
|
||||||
|
|
||||||
|
|
||||||
class OfagentMechanismPhysBridgeGenericTestCase(
|
|
||||||
OfagentMechanismPhysBridgeTestCase,
|
|
||||||
base.AgentMechanismGenericTestCase):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class OfagentMechanismPhysBridgeLocalTestCase(
|
|
||||||
OfagentMechanismPhysBridgeTestCase,
|
|
||||||
base.AgentMechanismLocalTestCase):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class OfagentMechanismPhysBridgeFlatTestCase(
|
|
||||||
OfagentMechanismPhysBridgeTestCase,
|
|
||||||
base.AgentMechanismFlatTestCase):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class OfagentMechanismPhysBridgeVlanTestCase(
|
|
||||||
OfagentMechanismPhysBridgeTestCase,
|
|
||||||
base.AgentMechanismVlanTestCase):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class OfagentMechanismPhysBridgeGreTestCase(
|
|
||||||
OfagentMechanismPhysBridgeTestCase,
|
|
||||||
base.AgentMechanismGreTestCase):
|
|
||||||
pass
|
|
||||||
|
Loading…
Reference in New Issue
Block a user