diff --git a/neutron/api/rpc/handlers/l3_rpc.py b/neutron/api/rpc/handlers/l3_rpc.py index b0d32be9b15..732cce6c67a 100644 --- a/neutron/api/rpc/handlers/l3_rpc.py +++ b/neutron/api/rpc/handlers/l3_rpc.py @@ -101,8 +101,7 @@ class L3RpcCallback(object): if utils.is_extension_supported( self.l3plugin, constants.L3_AGENT_SCHEDULER_EXT_ALIAS): if cfg.CONF.router_auto_schedule: - self.l3plugin.auto_schedule_routers(context, host, - router_ids=None) + self.l3plugin.auto_schedule_routers(context, host) return self.l3plugin.list_router_ids_on_host(context, host) @db_api.retry_db_errors diff --git a/neutron/db/l3_agentschedulers_db.py b/neutron/db/l3_agentschedulers_db.py index 7609b238597..759e29a08aa 100644 --- a/neutron/db/l3_agentschedulers_db.py +++ b/neutron/db/l3_agentschedulers_db.py @@ -445,10 +445,9 @@ class L3AgentSchedulerDbMixin(l3agentscheduler.L3AgentSchedulerPluginBase, candidates.append(l3_agent) return candidates - def auto_schedule_routers(self, context, host, router_ids=None): + def auto_schedule_routers(self, context, host): if self.router_scheduler: - self.router_scheduler.auto_schedule_routers( - self, context, host, router_ids) + self.router_scheduler.auto_schedule_routers(self, context, host) def schedule_router(self, context, router, candidates=None): if self.router_scheduler: diff --git a/neutron/scheduler/l3_agent_scheduler.py b/neutron/scheduler/l3_agent_scheduler.py index aa24cbe8ca1..88a348b5351 100644 --- a/neutron/scheduler/l3_agent_scheduler.py +++ b/neutron/scheduler/l3_agent_scheduler.py @@ -24,7 +24,6 @@ from neutron_lib import constants as lib_const from oslo_config import cfg from oslo_db import exception as db_exc from oslo_log import log as logging -from oslo_log import versionutils import six from neutron.common import utils @@ -74,7 +73,7 @@ class L3Scheduler(object): return [r for r in routers if r['id'] not in ids_to_discard] - def auto_schedule_routers(self, plugin, context, host, router_ids=None): + def auto_schedule_routers(self, plugin, context, host): """Schedule under-scheduled routers to L3 Agents. An under-scheduled router is a router that is either completely @@ -87,16 +86,7 @@ class L3Scheduler(object): all agents (not necessarily from the requesting host). If specified, under-scheduled routers are scheduled only to the agent on 'host'. - :param router_ids: currently unused and deprecated. - kept for backward compatibility. """ - if router_ids is not None: - versionutils.report_deprecated_feature( - LOG, - 'Passing router_ids has no effect on L3 agent ' - 'scheduling. This is deprecated and will be ' - 'removed in the Queens release.') - l3_agent = plugin.get_enabled_agent_on_host( context, lib_const.AGENT_TYPE_L3, host) if not l3_agent: diff --git a/neutron/tests/functional/scheduler/test_l3_agent_scheduler.py b/neutron/tests/functional/scheduler/test_l3_agent_scheduler.py index 497d1b0dbc7..f6dc2206bb2 100644 --- a/neutron/tests/functional/scheduler/test_l3_agent_scheduler.py +++ b/neutron/tests/functional/scheduler/test_l3_agent_scheduler.py @@ -108,8 +108,7 @@ class L3SchedulerBaseTest(test_db_base_plugin_v2.NeutronDbPluginV2TestCase): self.scheduler.auto_schedule_routers( self.l3_plugin, self.adminContext, - host, - router_ids) + host) hosting_after = self.l3_plugin.get_l3_agents_hosting_routers( self.adminContext, router_ids) @@ -525,7 +524,7 @@ class L3AZAutoScheduleTestCaseBase(L3AZSchedulerBaseTest): admin_state_up=True) scheduler.auto_schedule_routers(self.l3_plugin, self.adminContext, - activate_agent['host'], None) + activate_agent['host']) scheduled_agents = self.l3_plugin.get_l3_agents_hosting_routers( self.adminContext, [router['id']]) @@ -782,8 +781,7 @@ class L3DVRSchedulerTestCase(L3DVRSchedulerBaseTest): for host in self.hosts: self.scheduler.auto_schedule_routers( - self.l3_plugin, self.adminContext, - host, [self.router_to_schedule['id']]) + self.l3_plugin, self.adminContext, host) hosting_after = self.l3_plugin.get_l3_agents_hosting_routers( self.adminContext, [self.router_to_schedule['id']]) diff --git a/neutron/tests/unit/scheduler/test_l3_agent_scheduler.py b/neutron/tests/unit/scheduler/test_l3_agent_scheduler.py index 79ebafbd2ef..854bf0bfa43 100644 --- a/neutron/tests/unit/scheduler/test_l3_agent_scheduler.py +++ b/neutron/tests/unit/scheduler/test_l3_agent_scheduler.py @@ -725,9 +725,7 @@ class L3AgentChanceSchedulerTestCase(L3SchedulerTestCaseMixin, self._set_l3_agent_admin_state(self.adminContext, self.agent_id1, True) - self.plugin.auto_schedule_routers(self.adminContext, - 'host_1', - [r1['router']['id']]) + self.plugin.auto_schedule_routers(self.adminContext, 'host_1') agents = self.plugin.get_l3_agents_hosting_routers( self.adminContext, [r1['router']['id']], @@ -1716,10 +1714,8 @@ class L3HAChanceSchedulerTestCase(L3HATestCaseMixin): '_notify_router_updated').start() router = self._create_ha_router() - self.plugin.auto_schedule_routers( - self.adminContext, self.agent1.host, None) - self.plugin.auto_schedule_routers( - self.adminContext, self.agent2.host, None) + self.plugin.auto_schedule_routers(self.adminContext, self.agent1.host) + self.plugin.auto_schedule_routers(self.adminContext, self.agent2.host) agents = self.plugin.get_l3_agents_hosting_routers( self.adminContext, [router['id']]) self.assertEqual(2, len(agents)) @@ -1736,7 +1732,7 @@ class L3HAChanceSchedulerTestCase(L3HATestCaseMixin): router = self._create_ha_router() self.plugin.auto_schedule_routers( - self.adminContext, handle_internal_only_routers_agent.host, []) + self.adminContext, handle_internal_only_routers_agent.host) agents = self.plugin.get_l3_agents_hosting_routers( self.adminContext, [router['id']], admin_state_up=True) @@ -1749,8 +1745,7 @@ class L3HAChanceSchedulerTestCase(L3HATestCaseMixin): HOST_DVR, constants.L3_AGENT_MODE_DVR) router = self._create_ha_router() - self.plugin.auto_schedule_routers(self.adminContext, dvr_agent.host, - []) + self.plugin.auto_schedule_routers(self.adminContext, dvr_agent.host) agents = self.plugin.get_l3_agents_hosting_routers( self.adminContext, [router['id']], admin_state_up=True) @@ -1770,10 +1765,7 @@ class L3HAChanceSchedulerTestCase(L3HATestCaseMixin): agent = helpers.register_l3_agent(host='host_3') self.agent_id3 = agent.id - routers_to_auto_schedule = [router['id']] if specific_router else [] - self.plugin.auto_schedule_routers(self.adminContext, - 'host_3', - routers_to_auto_schedule) + self.plugin.auto_schedule_routers(self.adminContext, 'host_3') agents = self.plugin.get_l3_agents_hosting_routers( self.adminContext, [router['id']], @@ -1781,9 +1773,7 @@ class L3HAChanceSchedulerTestCase(L3HATestCaseMixin): self.assertEqual(3, len(agents)) # Simulate agent restart to make sure we don't try to re-bind - self.plugin.auto_schedule_routers(self.adminContext, - 'host_3', - routers_to_auto_schedule) + self.plugin.auto_schedule_routers(self.adminContext, 'host_3') class L3HALeastRoutersSchedulerTestCase(L3HATestCaseMixin): @@ -1977,8 +1967,7 @@ class L3AgentAZLeastRoutersSchedulerTestCase(L3HATestCaseMixin): def test_az_scheduler_auto_schedule(self): r1 = self._create_ha_router(ha=False, az_hints=['az1']) - self.plugin.auto_schedule_routers(self.adminContext, - 'az1-host2', None) + self.plugin.auto_schedule_routers(self.adminContext, 'az1-host2') agents = self.plugin.get_l3_agents_hosting_routers( self.adminContext, [r1['id']]) self.assertEqual(1, len(agents)) @@ -1986,8 +1975,7 @@ class L3AgentAZLeastRoutersSchedulerTestCase(L3HATestCaseMixin): def test_az_scheduler_auto_schedule_no_match(self): r1 = self._create_ha_router(ha=False, az_hints=['az1']) - self.plugin.auto_schedule_routers(self.adminContext, - 'az2-host1', None) + self.plugin.auto_schedule_routers(self.adminContext, 'az2-host1') agents = self.plugin.get_l3_agents_hosting_routers( self.adminContext, [r1['id']]) self.assertEqual(0, len(agents)) @@ -2064,8 +2052,7 @@ class L3AgentAZLeastRoutersSchedulerTestCase(L3HATestCaseMixin): self.assertEqual(set(['az1-host1', 'az3-host1']), hosts) self._set_l3_agent_admin_state(self.adminContext, self.agent6['id'], state=True) - self.plugin.auto_schedule_routers(self.adminContext, - 'az3-host2', None) + self.plugin.auto_schedule_routers(self.adminContext, 'az3-host2') agents = self.plugin.get_l3_agents_hosting_routers( self.adminContext, [r1['id']]) self.assertEqual(3, len(agents))