Add setup_privsep in agent's main function

As Neutron switched to use pyroute2 for managing namespaces in
4f627b4e8dfe699944a196fe90e0642cced6278f
neutron-lbaas needs to setup privsep in agent to make
possible manipulating with network namespaces.

Change-Id: I084f8d54cc619a1c99658396d5cab036a2663413
Closes-Bug: #1723856
This commit is contained in:
Sławek Kapłoński 2017-10-16 07:49:10 +00:00
parent a5294c1d11
commit 8ee7dd2da7
2 changed files with 3 additions and 0 deletions

View File

@ -57,6 +57,7 @@ def main():
common_config.init(sys.argv[1:])
config.setup_logging()
config.setup_privsep()
mgr = manager.LbaasAgentManager(cfg.CONF)
svc = LbaasAgentService(

View File

@ -35,7 +35,9 @@ class TestLbaasService(base.BaseTestCase):
def test_main(self):
logging_str = 'neutron.conf.agent.common.setup_logging'
privsep_str = 'neutron.conf.agent.common.setup_privsep'
with mock.patch(logging_str), \
mock.patch(privsep_str), \
mock.patch.object(agent.service, 'launch') as mock_launch, \
mock.patch('sys.argv'), \
mock.patch.object(agent.manager, 'LbaasAgentManager'), \