'is half or less than agent_down_time.')),
]
+INTERFACE_DRIVER_OPTS = [
+ cfg.StrOpt('interface_driver',
+ help=_("The driver used to manage the virtual interface.")),
+]
+
+USE_NAMESPACES_OPTS = [
+ cfg.BoolOpt('use_namespaces', default=True,
+ help=_("Allow overlapping IP.")),
+]
+
def get_log_args(conf, log_file_name):
cmd_args = []
conf.register_opts(AGENT_STATE_OPTS, 'AGENT')
+def register_interface_driver_opts_helper(conf):
+ conf.register_opts(INTERFACE_DRIVER_OPTS)
+
+
+def register_use_namespaces_opts_helper(conf):
+ conf.register_opts(USE_NAMESPACES_OPTS)
+
+
def get_root_helper(conf):
root_helper = conf.AGENT.root_helper
if root_helper != 'sudo':
cfg.StrOpt('dhcp_driver',
default='neutron.agent.linux.dhcp.Dnsmasq',
help=_("The driver used to manage the DHCP server.")),
- cfg.BoolOpt('use_namespaces', default=True,
- help=_("Allow overlapping IP.")),
cfg.BoolOpt('enable_isolated_metadata', default=False,
help=_("Support Metadata requests on isolated networks.")),
cfg.BoolOpt('enable_metadata_network', default=False,
def register_options():
cfg.CONF.register_opts(DhcpAgent.OPTS)
+ config.register_interface_driver_opts_helper(cfg.CONF)
+ config.register_use_namespaces_opts_helper(cfg.CONF)
config.register_agent_state_opts_helper(cfg.CONF)
config.register_root_helper(cfg.CONF)
cfg.CONF.register_opts(dhcp.OPTS)
cfg.StrOpt('external_network_bridge', default='br-ex',
help=_("Name of bridge used for external network "
"traffic.")),
- cfg.StrOpt('interface_driver',
- help=_("The driver used to manage the virtual "
- "interface.")),
cfg.IntOpt('metadata_port',
default=9697,
help=_("TCP Port used by Neutron metadata namespace "
default=0,
help=_("Send this many gratuitous ARPs for HA setup, if "
"less than or equal to 0, the feature is disabled")),
- cfg.BoolOpt('use_namespaces', default=True,
- help=_("Allow overlapping IP.")),
cfg.StrOpt('router_id', default='',
help=_("If namespaces is disabled, the l3 agent can only"
" configure a router that has the matching router "
eventlet.monkey_patch()
conf = cfg.CONF
conf.register_opts(L3NATAgent.OPTS)
+ config.register_interface_driver_opts_helper(conf)
+ config.register_use_namespaces_opts_helper(conf)
config.register_agent_state_opts_helper(conf)
config.register_root_helper(conf)
conf.register_opts(interface.OPTS)
'dnsmasq_lease_max',
default=(2 ** 24),
help=_('Limit number of leases to prevent a denial-of-service.')),
- cfg.StrOpt('interface_driver',
- help=_("The driver used to manage the virtual interface.")),
]
IPV4 = 4
conf = cfg.CONF
conf.register_cli_opts(cli_opts)
conf.register_opts(opts)
+ agent_config.register_interface_driver_opts_helper(conf)
agent_config.register_root_helper(conf)
conf.register_opts(dhcp.OPTS)
return conf
conf.register_cli_opts(opts)
conf.register_opts(l3_agent.L3NATAgent.OPTS)
conf.register_opts(interface.OPTS)
+ agent_config.register_interface_driver_opts_helper(conf)
+ agent_config.register_use_namespaces_opts_helper(conf)
agent_config.register_root_helper(conf)
return conf
OPTS = [
# Needed for drivers
- cfg.BoolOpt('use_namespaces', default=True,
- help=_("Use Linux network namespaces")),
- cfg.StrOpt('interface_driver',
- help=_("The driver used to manage the virtual "
- "interface.")),
cfg.StrOpt('external_network_bridge', default='br-ex',
help=_("Name of bridge used for external network "
"traffic.")),
client = self.client_manager.neutron
cfg.CONF.register_opts(interface.OPTS)
cfg.CONF.register_opts(NeutronDebugAgent.OPTS)
+ config.register_interface_driver_opts_helper(cfg.CONF)
+ config.register_use_namespaces_opts_helper(cfg.CONF)
config.register_root_helper(cfg.CONF)
cfg.CONF(['--config-file', self.options.config_file])
config.setup_logging(cfg.CONF)
eventlet.monkey_patch()
conf = cfg.CONF
conf.register_opts(vArmourL3NATAgent.OPTS)
+ config.register_interface_driver_opts_helper(conf)
+ config.register_use_namespaces_opts_helper(conf)
config.register_agent_state_opts_helper(conf)
config.register_root_helper(conf)
conf.register_opts(interface.OPTS)
cfg.CONF.register_opts(manager.OPTS)
# import interface options just in case the driver uses namespaces
cfg.CONF.register_opts(interface.OPTS)
+ config.register_interface_driver_opts_helper(cfg.CONF)
config.register_agent_state_opts_helper(cfg.CONF)
config.register_root_helper(cfg.CONF)
'.haproxy.namespace_driver.HaproxyNSDriver'],
help=_('Drivers used to manage loadbalancing devices'),
),
- cfg.StrOpt(
- 'interface_driver',
- help=_('The driver used to manage the virtual interface')
- ),
]
RULE = '-r-'
LABEL = '-l-'
-IptablesDriverOpts = [
- cfg.StrOpt('interface_driver',
- help=_("The driver used to manage the virtual "
- "interface.")),
- cfg.BoolOpt('use_namespaces', default=True,
- help=_("Allow overlapping IP."))
-]
+config.register_interface_driver_opts_helper(cfg.CONF)
+config.register_use_namespaces_opts_helper(cfg.CONF)
config.register_root_helper(cfg.CONF)
cfg.CONF.register_opts(interface.OPTS)
-cfg.CONF.register_opts(IptablesDriverOpts)
class IptablesManagerTransaction(object):
def setUp(self):
super(TestDhcpNoOpDriver, self).setUp()
self.conf = config.setup_conf()
+ config.register_interface_driver_opts_helper(self.conf)
self.conf.register_opts(base_config.core_opts)
self.conf.register_opts(dhcp.OPTS)
self.conf.enable_isolated_metadata = True
self.conf = cfg.ConfigOpts()
self.conf.register_opts(base_config.core_opts)
self.conf.register_opts(l3_agent.L3NATAgent.OPTS)
+ agent_config.register_use_namespaces_opts_helper(self.conf)
agent_config.register_root_helper(self.conf)
self.conf.root_helper = 'sudo'
self.api = FWaasAgent(self.conf)
self.conf = cfg.ConfigOpts()
self.conf.register_opts(base_config.core_opts)
self.conf.register_opts(varmour_router.vArmourL3NATAgent.OPTS)
+ agent_config.register_interface_driver_opts_helper(self.conf)
+ agent_config.register_use_namespaces_opts_helper(self.conf)
agent_config.register_root_helper(self.conf)
self.conf.register_opts(interface.OPTS)
self.conf.set_override('interface_driver',
self.conf = cfg.ConfigOpts()
self.conf.register_opts(base_config.core_opts)
self.conf.register_opts(varmour_router.vArmourL3NATAgent.OPTS)
+ agent_config.register_interface_driver_opts_helper(self.conf)
+ agent_config.register_use_namespaces_opts_helper(self.conf)
agent_config.register_root_helper(self.conf)
self.conf.register_opts(interface.OPTS)
self.conf.set_override('interface_driver',
self.conf.register_opts(base_config.core_opts)
self.conf.register_opts(l3_agent.L3NATAgent.OPTS)
self.conf.register_opts(interface.OPTS)
+ agent_config.register_interface_driver_opts_helper(self.conf)
+ agent_config.register_use_namespaces_opts_helper(self.conf)
agent_config.register_agent_state_opts_helper(self.conf)
agent_config.register_root_helper(self.conf)
cfg.CONF.register_opts(interface.OPTS)
cfg.CONF.register_opts(NeutronDebugAgent.OPTS)
cfg.CONF(args=[], project='neutron')
- cfg.CONF.set_override('use_namespaces', True)
+ config.register_interface_driver_opts_helper(cfg.CONF)
+ config.register_use_namespaces_opts_helper(cfg.CONF)
config.register_root_helper(cfg.CONF)
+ cfg.CONF.set_override('use_namespaces', True)
self.addCleanup(mock.patch.stopall)
device_exists_p = mock.patch(
'dhcp', '--config-file',
etcdir('neutron.conf.test')]
cfg.CONF.register_opts(dhcp_agent.DhcpAgent.OPTS)
+ config.register_interface_driver_opts_helper(cfg.CONF)
config.register_agent_state_opts_helper(cfg.CONF)
config.register_root_helper(cfg.CONF)
cfg.CONF.register_opts(dhcp.OPTS)
class TestDhcpAgentEventHandler(base.BaseTestCase):
def setUp(self):
super(TestDhcpAgentEventHandler, self).setUp()
+ config.register_interface_driver_opts_helper(cfg.CONF)
cfg.CONF.register_opts(dhcp.OPTS)
cfg.CONF.set_override('interface_driver',
'neutron.agent.linux.interface.NullDriver')
class TestDeviceManager(base.BaseTestCase):
def setUp(self):
super(TestDeviceManager, self).setUp()
+ config.register_interface_driver_opts_helper(cfg.CONF)
+ config.register_use_namespaces_opts_helper(cfg.CONF)
cfg.CONF.register_opts(dhcp_agent.DhcpAgent.OPTS)
cfg.CONF.register_opts(dhcp.OPTS)
cfg.CONF.set_override('interface_driver',
self.conf = cfg.ConfigOpts()
self.conf.register_opts(base_config.core_opts)
self.conf.register_opts(l3_agent.L3NATAgent.OPTS)
+ agent_config.register_interface_driver_opts_helper(self.conf)
+ agent_config.register_use_namespaces_opts_helper(self.conf)
agent_config.register_root_helper(self.conf)
self.conf.register_opts(interface.OPTS)
self.conf.set_override('router_id', 'fake_id')
self.conf = config.setup_conf()
self.conf.register_opts(base_config.core_opts)
self.conf.register_opts(dhcp.OPTS)
+ config.register_interface_driver_opts_helper(self.conf)
instance = mock.patch("neutron.agent.linux.dhcp.DeviceManager")
self.mock_mgr = instance.start()
self.conf.register_opt(cfg.BoolOpt('enable_isolated_metadata',
class TestMetaInterfaceDriver(TestBase):
def setUp(self):
super(TestMetaInterfaceDriver, self).setUp()
+ config.register_interface_driver_opts_helper(self.conf)
self.conf.register_opts(dhcp.OPTS)
self.client_cls_p = mock.patch('neutronclient.v2_0.client.Client')
client_cls = self.client_cls_p.start()