Merge "DVR Floating IP create don't raise exception if agent not found"

This commit is contained in:
Zuul 2018-11-22 00:16:01 +00:00 committed by Gerrit Code Review
commit 5d8c8d8feb
2 changed files with 4 additions and 9 deletions

View File

@ -983,8 +983,7 @@ class _DVRAgentInterfaceMixin(object):
try:
l3_agent_db = self._get_agent_by_type_and_host(
context, const.AGENT_TYPE_L3, host)
except agent_exc.AgentNotFoundByTypeHost(
agent_type=const.AGENT_TYPE_L3, host=host):
except agent_exc.AgentNotFoundByTypeHost:
LOG.warning("%(ag)s agent not found for the given host: %(host)s",
{'ag': const.AGENT_TYPE_L3,
'host': host})

View File

@ -20,7 +20,6 @@ from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib.exceptions import agent as agent_exc
from neutron_lib import constants
from neutron_lib import context
@ -338,12 +337,9 @@ class L3DvrTestCase(L3DvrTestCaseBase):
self.context, router['id'],
{'subnet_id': int_subnet['subnet']['id']})
if test_agent_mode is None:
self.assertRaises(
agent_exc.AgentNotFoundByTypeHost,
self.l3_plugin.create_fip_agent_gw_port_if_not_exists,
self.context,
ext_net_id,
'host1')
self.assertIsNone(
self.l3_plugin.create_fip_agent_gw_port_if_not_exists(
self.context, ext_net_id, 'host1'))
return
floating_ip = {'floating_network_id': ext_net_id,
'router_id': router['id'],