Skip to content

Commit

Permalink
Make the interface driver available to the router classes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Carl Baldwin committed Jan 28, 2015
1 parent 0a61edd commit 47ddd2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions neutron/agent/l3/agent.py
Expand Up @@ -354,6 +354,7 @@ def _create_router(self, router_id, router):
'use_ipv6': self.use_ipv6,
'ns_name': ns_name,
'agent_conf': self.conf,
'interface_driver': self.driver,
}

if router.get('distributed'):
Expand Down
2 changes: 2 additions & 0 deletions neutron/agent/l3/router_info.py
Expand Up @@ -22,6 +22,7 @@ def __init__(self,
router,
root_helper,
agent_conf,
interface_driver,
use_ipv6=False,
ns_name=None):
self.router_id = router_id
Expand All @@ -40,6 +41,7 @@ def __init__(self,
namespace=self.ns_name)
self.routes = []
self.agent_conf = agent_conf
self.driver = interface_driver

@property
def router(self):
Expand Down
3 changes: 2 additions & 1 deletion neutron/tests/unit/test_l3_agent.py
Expand Up @@ -274,7 +274,8 @@ def setUp(self):
'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()
Expand Down

0 comments on commit 47ddd2c

Please sign in to comment.