From: Carl Baldwin Date: Wed, 28 Jan 2015 17:50:31 +0000 (+0000) Subject: Make the interface driver available to the router classes X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=47ddd2cc03528d9bd66a18d8fcc74ae26aa83497;p=openstack-build%2Fneutron-build.git Make the interface driver available to the router classes Ultimately, it will only be the routers that need access to the interface driver and the agent won't need to use it for anything. However, it still makes sense for the agent to initialize it once and pass it to each of the routers as they're created. Multiple patches with multiple authors will be created to depend on this addition. Change-Id: I0ec75d731d816955c1915e283a137abcb51ac232 Partially-Implements: bp/restructure-l3-agent --- diff --git a/neutron/agent/l3/agent.py b/neutron/agent/l3/agent.py index bc929165c..c56d0e0b1 100644 --- a/neutron/agent/l3/agent.py +++ b/neutron/agent/l3/agent.py @@ -354,6 +354,7 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback, 'use_ipv6': self.use_ipv6, 'ns_name': ns_name, 'agent_conf': self.conf, + 'interface_driver': self.driver, } if router.get('distributed'): diff --git a/neutron/agent/l3/router_info.py b/neutron/agent/l3/router_info.py index 4fa023f1c..c76cf76c9 100644 --- a/neutron/agent/l3/router_info.py +++ b/neutron/agent/l3/router_info.py @@ -22,6 +22,7 @@ class RouterInfo(object): router, root_helper, agent_conf, + interface_driver, use_ipv6=False, ns_name=None): self.router_id = router_id @@ -40,6 +41,7 @@ class RouterInfo(object): namespace=self.ns_name) self.routes = [] self.agent_conf = agent_conf + self.driver = interface_driver @property def router(self): diff --git a/neutron/tests/unit/test_l3_agent.py b/neutron/tests/unit/test_l3_agent.py index 582a1eb8c..d7b5b687a 100644 --- a/neutron/tests/unit/test_l3_agent.py +++ b/neutron/tests/unit/test_l3_agent.py @@ -274,7 +274,8 @@ class TestBasicRouterOperations(base.BaseTestCase): 'id': _uuid(), 'device_id': _uuid()}] self.ri_kwargs = {'root_helper': self.conf.root_helper, - 'agent_conf': self.conf} + 'agent_conf': self.conf, + 'interface_driver': mock.sentinel.interface_driver} def _prepare_internal_network_data(self): port_id = _uuid()