diff --git a/neutron/agent/l3/config.py b/neutron/agent/l3/config.py index e094edbe261..d91bcdfe0aa 100644 --- a/neutron/agent/l3/config.py +++ b/neutron/agent/l3/config.py @@ -55,19 +55,5 @@ OPTS = [ cfg.BoolOpt('enable_metadata_proxy', default=True, help=_("Allow running metadata proxy.")), cfg.BoolOpt('router_delete_namespaces', default=False, - help=_("Delete namespace after removing a router.")), - cfg.StrOpt('metadata_proxy_socket', - default='$state_path/metadata_proxy', - help=_('Location of Metadata Proxy UNIX domain ' - 'socket')), - cfg.StrOpt('metadata_proxy_user', - default='', - help=_("User (uid or name) running metadata proxy after " - "its initialization (if empty: L3 agent effective " - "user)")), - cfg.StrOpt('metadata_proxy_group', - default='', - help=_("Group (gid or name) running metadata proxy after " - "its initialization (if empty: L3 agent effective " - "group)")) + help=_("Delete namespace after removing a router.")) ] diff --git a/neutron/agent/l3_agent.py b/neutron/agent/l3_agent.py index acd2733672b..2bcc4082ab2 100644 --- a/neutron/agent/l3_agent.py +++ b/neutron/agent/l3_agent.py @@ -26,6 +26,7 @@ from neutron.agent.l3 import config as l3_config from neutron.agent.l3 import ha from neutron.agent.linux import external_process from neutron.agent.linux import interface +from neutron.agent.metadata import driver as metadata_driver from neutron.common import config as common_config from neutron.common import topics from neutron.openstack.common import service @@ -34,6 +35,7 @@ from neutron import service as neutron_service def register_opts(conf): conf.register_opts(l3_config.OPTS) + conf.register_opts(metadata_driver.MetadataDriver.OPTS) conf.register_opts(ha.OPTS) config.register_interface_driver_opts_helper(conf) config.register_use_namespaces_opts_helper(conf) diff --git a/neutron/agent/metadata/driver.py b/neutron/agent/metadata/driver.py index da5b3eb510c..5c778f39c24 100644 --- a/neutron/agent/metadata/driver.py +++ b/neutron/agent/metadata/driver.py @@ -15,6 +15,8 @@ import os +from oslo.config import cfg + from neutron.agent.common import config from neutron.agent.linux import external_process from neutron.openstack.common import log as logging @@ -24,6 +26,24 @@ LOG = logging.getLogger(__name__) class MetadataDriver(advanced_service.AdvancedService): + + OPTS = [ + cfg.StrOpt('metadata_proxy_socket', + default='$state_path/metadata_proxy', + help=_('Location of Metadata Proxy UNIX domain ' + 'socket')), + cfg.StrOpt('metadata_proxy_user', + default='', + help=_("User (uid or name) running metadata proxy after " + "its initialization (if empty: L3 agent effective " + "user)")), + cfg.StrOpt('metadata_proxy_group', + default='', + help=_("Group (gid or name) running metadata proxy after " + "its initialization (if empty: L3 agent effective " + "group)")) + ] + def __init__(self, l3_agent): super(MetadataDriver, self).__init__(l3_agent) self.metadata_port = l3_agent.conf.metadata_port diff --git a/neutron/tests/unit/agent/metadata/test_driver.py b/neutron/tests/unit/agent/metadata/test_driver.py index e17ee59f83d..48f87ea8d25 100644 --- a/neutron/tests/unit/agent/metadata/test_driver.py +++ b/neutron/tests/unit/agent/metadata/test_driver.py @@ -37,6 +37,7 @@ class TestMetadataDriver(base.BaseTestCase): def setUp(self): super(TestMetadataDriver, self).setUp() cfg.CONF.register_opts(l3_config.OPTS) + cfg.CONF.register_opts(metadata_driver.MetadataDriver.OPTS) agent_config.register_root_helper(cfg.CONF) def test_metadata_nat_rules(self):