The dvr_update_router_addvm un-necessarily calls the
get_port to retreive the port dict, even though the port
dict is already passed in.
So this patch will remove the get_port call.
Change-Id: Ib893024ef0cf811497f077f5ae9d3965ea19f288
"""
def dvr_update_router_addvm(self, context, port):
- port_dict = self._core_plugin.get_port(context, port['id'])
- port_host = port_dict[portbindings.HOST_ID]
+ port_host = port[portbindings.HOST_ID]
l3_agent_on_host = (self.get_l3_agents(
context, filters={'host': [port_host]}) or [None])[0]
if not l3_agent_on_host:
return_value=dvr_ports),\
mock.patch('neutron.api.rpc.agentnotifiers.l3_rpc_agent_api'
'.L3AgentNotifyAPI'),\
- mock.patch(
- 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2.get_port',
- return_value=port),\
mock.patch.object(
self.dut, 'get_l3_agents',
return_value=[agent_on_host]) as get_l3_agents: