Initialize privsep library in Neutron commands

Since the migration to privsep, some Neutron commands execute methods
under a privsep context. The privsep library must be initialized first.

Change-Id: Icd69bca23d781bace580b3937bc8bd25b586e852
Closes-Bug: #1923870
(cherry picked from commit 088f1298f2)
This commit is contained in:
Rodolfo Alonso Hernandez 2021-04-14 16:37:08 +00:00 committed by Rodolfo Alonso
parent df0a76beec
commit de78aaec9d
2 changed files with 3 additions and 0 deletions

View File

@ -33,6 +33,7 @@ def setup_conf():
"""
conf = cfg.CONF
agent_config.register_root_helper(conf=conf)
agent_config.setup_privsep()
command.register_cmd_opts(command.ip_opts, conf)
return conf

View File

@ -22,6 +22,7 @@ from neutron._i18n import _
from neutron.agent import dhcp_agent
from neutron.cmd.sanity import checks
from neutron.common import config
from neutron.conf.agent import common as agent_config
from neutron.conf.agent import securitygroups_rpc
from neutron.conf.db import l3_hamode_db
from neutron.conf.plugins.ml2 import config as ml2_conf
@ -419,6 +420,7 @@ def main():
cfg.CONF.set_override('use_stderr', True)
config.setup_logging()
config.init(sys.argv[1:], default_config_files=[])
agent_config.setup_privsep()
if cfg.CONF.config_file:
enable_tests_from_config()