Merge "Fixed AttributeError in l2pop.delete_port_postcommit"

This commit is contained in:
Jenkins 2017-07-17 21:33:58 +00:00 committed by Gerrit Code Review
commit 88aa9dbf9e
2 changed files with 9 additions and 1 deletions

View File

@ -76,7 +76,7 @@ class L2populationMechanismDriver(api.MechanismDriver):
fdb_entries = self._get_agent_fdb(
plugin_context, context.bottom_bound_segment, port, agent_host)
if fdb_entries and l3_hamode_db.is_ha_router_port(
context, port['device_owner'], port['device_id']):
plugin_context, port['device_owner'], port['device_id']):
session = db_api.get_reader_session()
network_id = port['network_id']
other_fdb_ports = self._get_ha_port_agents_fdb(

View File

@ -1146,6 +1146,14 @@ class TestL2PopulationRpcTestCase(test_plugin.Ml2PluginV2TestCase):
self.driver.get_network(
self.context, p['port']['network_id']),
models.PortBinding(), bindings)
fdbs = {
p['port']['network_id']: {
'segment_id': 'fakeid',
'ports': {},
}
}
mock.patch.object(
l2pop_mech, '_get_agent_fdb', return_value=fdbs).start()
# The point is to provide coverage and to assert that
# no exceptions are raised.
l2pop_mech.delete_port_postcommit(port_context)