Fixed AttributeError in l2pop.delete_port_postcommit
The error sneaked in with Ib6e59ab3405857d3ed4d82df1a80800089c3f06e where is_ha_router_port expects a NeutronContext object but we still pass PortContext instead. Change-Id: I593af5d050de00ddea7d758007d9856c4b97695f Closes-Bug: #1703938
This commit is contained in:
parent
b88d0a80a6
commit
5c331ecbd2
neutron
@ -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(
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user