From 32d1f401a0fbe3e9905f912c75f204c183d66f09 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Fri, 25 Aug 2017 10:25:34 -0700 Subject: [PATCH] l3 agent: stop expecting old server when fetching service plugins All Newton+ servers using L3RouterPlugin expose the endpoint. Even back in Newton time when the patch that introduced the new RPC entry point, there was no need to have this special handling, because neutron-server is always upgraded before agents. TrivialFix Change-Id: I2afa84d6b5771600068f8e98c407bbdce2f266b0 --- neutron/agent/l3/agent.py | 9 --------- neutron/tests/unit/agent/l3/test_agent.py | 7 ------- 2 files changed, 16 deletions(-) diff --git a/neutron/agent/l3/agent.py b/neutron/agent/l3/agent.py index 3e20ed34aaa..c9ab0d95885 100644 --- a/neutron/agent/l3/agent.py +++ b/neutron/agent/l3/agent.py @@ -220,15 +220,6 @@ class L3NATAgent(ha.AgentMixin, try: self.neutron_service_plugins = ( self.plugin_rpc.get_service_plugin_list(self.context)) - except oslo_messaging.RemoteError as e: - LOG.warning('l3-agent cannot check service plugins ' - 'enabled at the neutron server when ' - 'startup due to RPC error. It happens ' - 'when the server does not support this ' - 'RPC API. If the error is ' - 'UnsupportedVersion you can ignore this ' - 'warning. Detail message: %s', e) - self.neutron_service_plugins = None except oslo_messaging.MessagingTimeout as e: LOG.warning('l3-agent cannot contact neutron server ' 'to retrieve service plugins enabled. ' diff --git a/neutron/tests/unit/agent/l3/test_agent.py b/neutron/tests/unit/agent/l3/test_agent.py index 03042de4de6..be0ee3a138c 100644 --- a/neutron/tests/unit/agent/l3/test_agent.py +++ b/neutron/tests/unit/agent/l3/test_agent.py @@ -2643,13 +2643,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework): self.assertEqual(service_plugins, agent.neutron_service_plugins) self.assertTrue(self.plugin_api.get_service_plugin_list.called) - def test_get_service_plugin_list_failed(self): - raise_rpc = oslo_messaging.RemoteError() - self.plugin_api.get_service_plugin_list.side_effect = raise_rpc - agent = l3_agent.L3NATAgent(HOSTNAME, self.conf) - self.assertIsNone(agent.neutron_service_plugins) - self.assertTrue(self.plugin_api.get_service_plugin_list.called) - def test_get_service_plugin_list_retried(self): raise_timeout = oslo_messaging.MessagingTimeout() # Raise a timeout the first 2 times it calls