]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Make the interface driver available to the router classes
authorCarl Baldwin <carl.baldwin@hp.com>
Wed, 28 Jan 2015 17:50:31 +0000 (17:50 +0000)
committerCarl Baldwin <carl.baldwin@hp.com>
Wed, 28 Jan 2015 17:50:31 +0000 (17:50 +0000)
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

neutron/agent/l3/agent.py
neutron/agent/l3/router_info.py
neutron/tests/unit/test_l3_agent.py

index bc929165c7f85f7c2c4ec9583491833625f36aa6..c56d0e0b16ad472aad59c08970a1885777a194a8 100644 (file)
@@ -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'):
index 4fa023f1c189d9fb30b330d08c2cb1a6b9510fb2..c76cf76c9fd57c24b87f6c905f6ff52f2e1acd1c 100644 (file)
@@ -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):
index 582a1eb8cfab16aac496345455bc969c5cc51fb6..d7b5b687a45bec1b779de96a19fac5f8cce06b7f 100644 (file)
@@ -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()