Refactoring agent linux&ovsdb config
Refactoring neutron agent linux and ovsdb config opts to be in neutron/conf/agent so that all the config options reside in a centralized location. This simplifies the process of looking up the config opts and provides an easy way to import. NeutronLibImpact Change-Id: Ib1e0e63dec2985c417412d1ecc68e2a74ef87182 Partial-Bug: #1563069
This commit is contained in:
parent
1ce7b689b3
commit
51ca683797
@ -17,11 +17,13 @@ import os
|
||||
|
||||
if os.name == 'nt':
|
||||
from neutron.agent.windows import ip_lib
|
||||
from neutron.conf.agent import windows
|
||||
OPTS = windows.IP_LIB_OPTS_WINDOWS
|
||||
else:
|
||||
from neutron.agent.linux import ip_lib
|
||||
from neutron.conf.agent import linux
|
||||
OPTS = linux.IP_LIB_OPTS_LINUX
|
||||
|
||||
|
||||
OPTS = ip_lib.OPTS
|
||||
|
||||
IPWrapper = ip_lib.IPWrapper
|
||||
IPDevice = ip_lib.IPDevice
|
||||
|
@ -19,7 +19,6 @@ import sys
|
||||
from oslo_config import cfg
|
||||
from oslo_service import service
|
||||
|
||||
from neutron.agent.linux import interface
|
||||
from neutron.common import config as common_config
|
||||
from neutron.common import topics
|
||||
from neutron.conf.agent import common as config
|
||||
@ -34,7 +33,7 @@ def register_options(conf):
|
||||
config.register_availability_zone_opts_helper(conf)
|
||||
dhcp_config.register_agent_dhcp_opts(conf)
|
||||
meta_conf.register_meta_conf_opts(meta_conf.SHARED_OPTS, conf)
|
||||
conf.register_opts(interface.OPTS)
|
||||
config.register_interface_opts(conf)
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -19,10 +19,6 @@ import sys
|
||||
from oslo_config import cfg
|
||||
from oslo_service import service
|
||||
|
||||
from neutron.agent.linux import external_process
|
||||
from neutron.agent.linux import interface
|
||||
from neutron.agent.linux import pd
|
||||
from neutron.agent.linux import ra
|
||||
from neutron.common import config as common_config
|
||||
from neutron.common import topics
|
||||
from neutron.conf.agent import common as config
|
||||
@ -38,10 +34,10 @@ def register_opts(conf):
|
||||
meta_conf.register_meta_conf_opts(meta_conf.SHARED_OPTS, conf)
|
||||
config.register_interface_driver_opts_helper(conf)
|
||||
config.register_agent_state_opts_helper(conf)
|
||||
conf.register_opts(interface.OPTS)
|
||||
conf.register_opts(external_process.OPTS)
|
||||
conf.register_opts(pd.OPTS)
|
||||
conf.register_opts(ra.OPTS)
|
||||
config.register_interface_opts(conf)
|
||||
config.register_external_process_opts(conf)
|
||||
config.register_pddriver_opts(conf)
|
||||
config.register_ra_opts(conf)
|
||||
config.register_availability_zone_opts_helper(conf)
|
||||
|
||||
|
||||
|
@ -24,23 +24,15 @@ from oslo_utils import fileutils
|
||||
import psutil
|
||||
import six
|
||||
|
||||
from neutron._i18n import _
|
||||
from neutron.agent.linux import ip_lib
|
||||
from neutron.agent.linux import utils
|
||||
|
||||
from neutron.conf.agent import common as agent_cfg
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
OPTS = [
|
||||
cfg.StrOpt('external_pids',
|
||||
default='$state_path/external/pids',
|
||||
help=_('Location to store child pid files')),
|
||||
]
|
||||
|
||||
|
||||
cfg.CONF.register_opts(OPTS)
|
||||
agent_cfg.register_external_process_opts()
|
||||
agent_cfg.register_process_monitor_opts(cfg.CONF)
|
||||
|
||||
|
||||
|
@ -18,32 +18,17 @@ import time
|
||||
|
||||
import netaddr
|
||||
from neutron_lib import constants
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
|
||||
from neutron._i18n import _
|
||||
from neutron.agent.common import ovs_lib
|
||||
from neutron.agent.linux import ip_lib
|
||||
from neutron.agent.linux import utils
|
||||
from neutron.common import constants as n_const
|
||||
from neutron.common import exceptions
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
OPTS = [
|
||||
cfg.StrOpt('ovs_integration_bridge',
|
||||
default='br-int',
|
||||
help=_('Name of Open vSwitch bridge to use')),
|
||||
cfg.BoolOpt('ovs_use_veth',
|
||||
default=False,
|
||||
help=_('Uses veth for an OVS interface or not. '
|
||||
'Support kernels with limited namespace support '
|
||||
'(e.g. RHEL 6.5) so long as ovs_use_veth is set to '
|
||||
'True.')),
|
||||
]
|
||||
|
||||
|
||||
def _get_veth(name1, name2, namespace2):
|
||||
return (ip_lib.IPDevice(name1),
|
||||
|
@ -35,11 +35,6 @@ from neutron.privileged.agent.linux import ip_lib as privileged
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
OPTS = [
|
||||
cfg.BoolOpt('ip_lib_force_root',
|
||||
default=False,
|
||||
help=_('Force ip_lib calls to use the root helper')),
|
||||
]
|
||||
|
||||
IP_NONLOCAL_BIND = 'net.ipv4.ip_nonlocal_bind'
|
||||
|
||||
|
@ -21,24 +21,16 @@ from neutron_lib.callbacks import events
|
||||
from neutron_lib.callbacks import registry
|
||||
from neutron_lib.callbacks import resources
|
||||
from neutron_lib import constants as n_const
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import netutils
|
||||
import six
|
||||
from stevedore import driver
|
||||
|
||||
from neutron._i18n import _
|
||||
from neutron.common import constants as l3_constants
|
||||
from neutron.common import utils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
OPTS = [
|
||||
cfg.StrOpt('pd_dhcp_driver',
|
||||
default='dibbler',
|
||||
help=_('Service to handle DHCPv6 Prefix delegation.')),
|
||||
]
|
||||
|
||||
|
||||
class PrefixDelegation(object):
|
||||
def __init__(self, context, pmon, intf_driver, notifier, pd_update_cb,
|
||||
|
@ -15,22 +15,11 @@
|
||||
|
||||
import abc
|
||||
|
||||
from oslo_config import cfg
|
||||
import six
|
||||
|
||||
from neutron._i18n import _
|
||||
from neutron.conf.agent import common as agent_conf
|
||||
|
||||
OPTS = [
|
||||
cfg.StrOpt('pd_confs',
|
||||
default='$state_path/pd',
|
||||
help=_('Location to store IPv6 PD files.')),
|
||||
cfg.StrOpt('vendor_pen',
|
||||
default='8888',
|
||||
help=_("A decimal value as Vendor's Registered Private "
|
||||
"Enterprise Number as required by RFC3315 DUID-EN.")),
|
||||
]
|
||||
|
||||
cfg.CONF.register_opts(OPTS)
|
||||
agent_conf.register_pddriver_opts()
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
|
@ -19,16 +19,13 @@ import jinja2
|
||||
import netaddr
|
||||
from neutron_lib import constants
|
||||
from neutron_lib.utils import file as file_utils
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
|
||||
from neutron._i18n import _
|
||||
from neutron.agent.linux import external_process
|
||||
from neutron.agent.linux import utils
|
||||
from neutron.common import constants as n_const
|
||||
|
||||
|
||||
RADVD_SERVICE_NAME = 'radvd'
|
||||
RADVD_SERVICE_CMD = 'radvd'
|
||||
# We can configure max of 3 DNS servers in radvd RDNSS section.
|
||||
@ -36,17 +33,6 @@ MAX_RDNSS_ENTRIES = 3
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
OPTS = [
|
||||
cfg.StrOpt('ra_confs',
|
||||
default='$state_path/ra',
|
||||
help=_('Location to store IPv6 RA config files')),
|
||||
cfg.IntOpt('min_rtr_adv_interval',
|
||||
default=30,
|
||||
help=_('MinRtrAdvInterval setting for radvd.conf')),
|
||||
cfg.IntOpt('max_rtr_adv_interval',
|
||||
default=100,
|
||||
help=_('MaxRtrAdvInterval setting for radvd.conf')),
|
||||
]
|
||||
|
||||
CONFIG_TEMPLATE = jinja2.Template("""interface {{ interface_name }}
|
||||
{
|
||||
|
@ -21,7 +21,7 @@ from oslo_utils import importutils
|
||||
from ovsdbapp import api
|
||||
from ovsdbapp import exceptions
|
||||
|
||||
from neutron._i18n import _
|
||||
from neutron.conf.agent import ovsdb_api
|
||||
|
||||
API = moves.moved_class(api.API, 'API', __name__)
|
||||
Command = moves.moved_class(api.Command, 'Command', __name__)
|
||||
@ -29,31 +29,14 @@ Transaction = moves.moved_class(api.Transaction, 'Transaction', __name__)
|
||||
TimeoutException = moves.moved_class(exceptions.TimeoutException,
|
||||
'TimeoutException', __name__)
|
||||
|
||||
interface_map = {
|
||||
'vsctl': 'neutron.agent.ovsdb.impl_vsctl',
|
||||
'native': 'neutron.agent.ovsdb.impl_idl',
|
||||
}
|
||||
|
||||
OPTS = [
|
||||
cfg.StrOpt('ovsdb_interface',
|
||||
choices=interface_map.keys(),
|
||||
default='native',
|
||||
help=_('The interface for interacting with the OVSDB')),
|
||||
cfg.StrOpt('ovsdb_connection',
|
||||
default='tcp:127.0.0.1:6640',
|
||||
help=_('The connection string for the OVSDB backend. '
|
||||
'Will be used by ovsdb-client when monitoring and '
|
||||
'used for the all ovsdb commands when native '
|
||||
'ovsdb_interface is enabled'
|
||||
))
|
||||
]
|
||||
cfg.CONF.register_opts(OPTS, 'OVS')
|
||||
ovsdb_api.register_ovsdb_api_opts()
|
||||
|
||||
|
||||
def from_config(context, iface_name=None):
|
||||
"""Return the configured OVSDB API implementation"""
|
||||
iface = importutils.import_module(
|
||||
interface_map[iface_name or cfg.CONF.OVS.ovsdb_interface])
|
||||
ovsdb_api.interface_map[iface_name or cfg.CONF.OVS.ovsdb_interface])
|
||||
return iface.api_factory(context)
|
||||
|
||||
|
||||
|
@ -19,8 +19,6 @@ from oslo_log import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
OPTS = []
|
||||
|
||||
|
||||
class IPWrapper(object):
|
||||
|
||||
|
@ -29,7 +29,6 @@ from neutron.agent.l3 import dvr_snat_ns
|
||||
from neutron.agent.l3 import namespaces
|
||||
from neutron.agent.linux import dhcp
|
||||
from neutron.agent.linux import external_process
|
||||
from neutron.agent.linux import interface
|
||||
from neutron.agent.linux import ip_lib
|
||||
from neutron.agent.linux import utils
|
||||
from neutron.common import config
|
||||
@ -37,7 +36,6 @@ from neutron.conf.agent import cmd
|
||||
from neutron.conf.agent import common as agent_config
|
||||
from neutron.conf.agent import dhcp as dhcp_config
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
LB_NS_PREFIX = 'qlbaas-'
|
||||
NS_PREFIXES = {
|
||||
@ -73,7 +71,7 @@ def setup_conf():
|
||||
cmd.register_cmd_opts(cmd.netns_opts, conf)
|
||||
agent_config.register_interface_driver_opts_helper(conf)
|
||||
dhcp_config.register_agent_dhcp_opts(conf)
|
||||
conf.register_opts(interface.OPTS)
|
||||
agent_config.register_interface_opts()
|
||||
return conf
|
||||
|
||||
|
||||
|
@ -17,7 +17,6 @@ from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from neutron.agent.common import ovs_lib
|
||||
from neutron.agent.linux import interface
|
||||
from neutron.agent.linux import ip_lib
|
||||
from neutron.common import config
|
||||
from neutron.conf.agent import cmd
|
||||
@ -25,7 +24,6 @@ from neutron.conf.agent import common as agent_config
|
||||
from neutron.conf.agent.l3 import config as l3_config
|
||||
from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@ -39,8 +37,8 @@ def setup_conf():
|
||||
conf = cfg.CONF
|
||||
cmd.register_cmd_opts(cmd.ovs_opts, conf)
|
||||
l3_config.register_l3_agent_config_opts(l3_config.OPTS, conf)
|
||||
conf.register_opts(interface.OPTS)
|
||||
agent_config.register_interface_driver_opts_helper(conf)
|
||||
agent_config.register_interface_opts()
|
||||
return conf
|
||||
|
||||
|
||||
|
@ -23,6 +23,57 @@ from neutron._i18n import _
|
||||
from neutron.common import config
|
||||
|
||||
|
||||
EXTERNAL_PROCESS_OPTS = [
|
||||
cfg.StrOpt('external_pids',
|
||||
default='$state_path/external/pids',
|
||||
help=_('Location to store child pid files')),
|
||||
]
|
||||
|
||||
|
||||
PD_OPTS = [
|
||||
cfg.StrOpt('pd_dhcp_driver',
|
||||
default='dibbler',
|
||||
help=_('Service to handle DHCPv6 Prefix delegation.')),
|
||||
]
|
||||
|
||||
|
||||
PD_DRIVER_OPTS = [
|
||||
cfg.StrOpt('pd_confs',
|
||||
default='$state_path/pd',
|
||||
help=_('Location to store IPv6 PD files.')),
|
||||
cfg.StrOpt('vendor_pen',
|
||||
default='8888',
|
||||
help=_("A decimal value as Vendor's Registered Private "
|
||||
"Enterprise Number as required by RFC3315 DUID-EN.")),
|
||||
]
|
||||
|
||||
|
||||
INTERFACE_OPTS = [
|
||||
cfg.StrOpt('ovs_integration_bridge',
|
||||
default='br-int',
|
||||
help=_('Name of Open vSwitch bridge to use')),
|
||||
cfg.BoolOpt('ovs_use_veth',
|
||||
default=False,
|
||||
help=_('Uses veth for an OVS interface or not. '
|
||||
'Support kernels with limited namespace support '
|
||||
'(e.g. RHEL 6.5) so long as ovs_use_veth is set to '
|
||||
'True.')),
|
||||
]
|
||||
|
||||
|
||||
RA_OPTS = [
|
||||
cfg.StrOpt('ra_confs',
|
||||
default='$state_path/ra',
|
||||
help=_('Location to store IPv6 RA config files')),
|
||||
cfg.IntOpt('min_rtr_adv_interval',
|
||||
default=30,
|
||||
help=_('MinRtrAdvInterval setting for radvd.conf')),
|
||||
cfg.IntOpt('max_rtr_adv_interval',
|
||||
default=100,
|
||||
help=_('MaxRtrAdvInterval setting for radvd.conf')),
|
||||
]
|
||||
|
||||
|
||||
ROOT_HELPER_OPTS = [
|
||||
cfg.StrOpt('root_helper', default='sudo',
|
||||
help=_("Root helper application. "
|
||||
@ -131,6 +182,26 @@ def get_log_args(conf, log_file_name, **kwargs):
|
||||
return cmd_args
|
||||
|
||||
|
||||
def register_external_process_opts(cfg=cfg.CONF):
|
||||
cfg.register_opts(EXTERNAL_PROCESS_OPTS)
|
||||
|
||||
|
||||
def register_pd_opts(cfg=cfg.CONF):
|
||||
cfg.register_opts(PD_OPTS)
|
||||
|
||||
|
||||
def register_pddriver_opts(cfg=cfg.CONF):
|
||||
cfg.register_opts(PD_DRIVER_OPTS)
|
||||
|
||||
|
||||
def register_interface_opts(cfg=cfg.CONF):
|
||||
cfg.register_opts(INTERFACE_OPTS)
|
||||
|
||||
|
||||
def register_ra_opts(cfg=cfg.CONF):
|
||||
cfg.register_opts(RA_OPTS)
|
||||
|
||||
|
||||
def register_root_helper(conf=cfg.CONF):
|
||||
conf.register_opts(ROOT_HELPER_OPTS, 'AGENT')
|
||||
|
||||
|
28
neutron/conf/agent/linux.py
Normal file
28
neutron/conf/agent/linux.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Copyright 2017 OpenStack Foundation
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron._i18n import _
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
IP_LIB_OPTS_LINUX = [
|
||||
cfg.BoolOpt('ip_lib_force_root',
|
||||
default=False,
|
||||
help=_('Force ip_lib calls to use the root helper')),
|
||||
]
|
||||
|
||||
|
||||
def register_iplib_opts(cfg=cfg.CONF):
|
||||
cfg.register_opts(IP_LIB_OPTS_LINUX)
|
42
neutron/conf/agent/ovsdb_api.py
Normal file
42
neutron/conf/agent/ovsdb_api.py
Normal file
@ -0,0 +1,42 @@
|
||||
# Copyright 2017 OpenStack Foundation
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron._i18n import _
|
||||
from oslo_config import cfg
|
||||
|
||||
|
||||
interface_map = {
|
||||
'vsctl': 'neutron.agent.ovsdb.impl_vsctl',
|
||||
'native': 'neutron.agent.ovsdb.impl_idl',
|
||||
}
|
||||
|
||||
|
||||
API_OPTS = [
|
||||
cfg.StrOpt('ovsdb_interface',
|
||||
choices=interface_map.keys(),
|
||||
default='native',
|
||||
help=_('The interface for interacting with the OVSDB')),
|
||||
cfg.StrOpt('ovsdb_connection',
|
||||
default='tcp:127.0.0.1:6640',
|
||||
help=_('The connection string for the OVSDB backend. '
|
||||
'Will be used by ovsdb-client when monitoring and '
|
||||
'used for the all ovsdb commands when native '
|
||||
'ovsdb_interface is enabled'
|
||||
))
|
||||
]
|
||||
|
||||
|
||||
def register_ovsdb_api_opts(cfg=cfg.CONF):
|
||||
cfg.register_opts(API_OPTS, 'OVS')
|
17
neutron/conf/agent/windows.py
Normal file
17
neutron/conf/agent/windows.py
Normal file
@ -0,0 +1,17 @@
|
||||
# Copyright 2017 OpenStack Foundation
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
|
||||
IP_LIB_OPTS_WINDOWS = []
|
@ -20,7 +20,6 @@ from oslo_utils import importutils
|
||||
|
||||
from neutron._i18n import _
|
||||
from neutron.agent.common import utils
|
||||
from neutron.agent.linux import interface
|
||||
from neutron.conf.agent import common as config
|
||||
from neutron.debug import debug_agent
|
||||
from neutronclient.common import exceptions as exc
|
||||
@ -71,7 +70,7 @@ class NeutronDebugShell(shell.NeutronShell):
|
||||
_("You must provide a config file for bridge -"
|
||||
" either --config-file or env[NEUTRON_TEST_CONFIG_FILE]"))
|
||||
client = self.client_manager.neutron
|
||||
cfg.CONF.register_opts(interface.OPTS)
|
||||
config.register_interface_opts()
|
||||
cfg.CONF.register_opts(config.EXT_NET_BRIDGE_OPTS)
|
||||
config.register_interface_driver_opts_helper(cfg.CONF)
|
||||
cfg.CONF(['--config-file', self.options.config_file])
|
||||
|
@ -18,10 +18,6 @@ from keystoneauth1 import loading as ks_loading
|
||||
from oslo_config import cfg
|
||||
|
||||
import neutron.agent.agent_extensions_manager
|
||||
import neutron.agent.linux.interface
|
||||
import neutron.agent.linux.pd
|
||||
import neutron.agent.linux.ra
|
||||
import neutron.agent.ovsdb.api
|
||||
import neutron.agent.securitygroups_rpc
|
||||
import neutron.common.cache_utils
|
||||
import neutron.conf.agent.agent_extensions_manager
|
||||
@ -29,8 +25,10 @@ import neutron.conf.agent.common
|
||||
import neutron.conf.agent.dhcp
|
||||
import neutron.conf.agent.l3.config
|
||||
import neutron.conf.agent.l3.ha
|
||||
import neutron.conf.agent.linux
|
||||
import neutron.conf.agent.metadata.config as meta_conf
|
||||
import neutron.conf.agent.ovs_conf
|
||||
import neutron.conf.agent.ovsdb_api
|
||||
import neutron.conf.agent.xenapi_conf
|
||||
import neutron.conf.cache_utils
|
||||
import neutron.conf.common
|
||||
@ -146,12 +144,12 @@ def list_base_agent_opts():
|
||||
return [
|
||||
('DEFAULT',
|
||||
itertools.chain(
|
||||
neutron.agent.linux.interface.OPTS,
|
||||
neutron.conf.agent.common.INTERFACE_OPTS,
|
||||
neutron.conf.agent.common.INTERFACE_DRIVER_OPTS,
|
||||
neutron.conf.agent.ovs_conf.OPTS)
|
||||
),
|
||||
('agent', neutron.conf.agent.common.AGENT_STATE_OPTS),
|
||||
('ovs', neutron.agent.ovsdb.api.OPTS),
|
||||
('ovs', neutron.conf.agent.ovsdb_api.API_OPTS),
|
||||
]
|
||||
|
||||
|
||||
@ -196,8 +194,8 @@ def list_l3_agent_opts():
|
||||
neutron.conf.agent.l3.config.OPTS,
|
||||
neutron.conf.service.service_opts,
|
||||
neutron.conf.agent.l3.ha.OPTS,
|
||||
neutron.agent.linux.pd.OPTS,
|
||||
neutron.agent.linux.ra.OPTS)
|
||||
neutron.conf.agent.common.PD_DRIVER_OPTS,
|
||||
neutron.conf.agent.common.RA_OPTS)
|
||||
),
|
||||
('agent',
|
||||
neutron.conf.agent.agent_extensions_manager.AGENT_EXT_MANAGER_OPTS),
|
||||
@ -258,7 +256,7 @@ def list_ovs_opts():
|
||||
('ovs',
|
||||
itertools.chain(
|
||||
neutron.conf.plugins.ml2.drivers.ovs_conf.ovs_opts,
|
||||
neutron.agent.ovsdb.api.OPTS)
|
||||
neutron.conf.agent.ovsdb_api.API_OPTS)
|
||||
),
|
||||
('agent',
|
||||
itertools.chain(
|
||||
|
@ -20,7 +20,6 @@ from oslo_utils import importutils
|
||||
from neutron._i18n import _
|
||||
from neutron.agent.l3 import dvr_snat_ns
|
||||
from neutron.agent.l3 import namespaces
|
||||
from neutron.agent.linux import interface
|
||||
from neutron.agent.linux import ip_lib
|
||||
from neutron.agent.linux import iptables_manager
|
||||
from neutron.common import constants
|
||||
@ -39,7 +38,7 @@ RULE = '-r-'
|
||||
LABEL = '-l-'
|
||||
|
||||
config.register_interface_driver_opts_helper(cfg.CONF)
|
||||
cfg.CONF.register_opts(interface.OPTS)
|
||||
config.register_interface_opts()
|
||||
|
||||
|
||||
class IptablesManagerTransaction(object):
|
||||
|
@ -767,7 +767,7 @@ class OVSPortFixture(PortFixture):
|
||||
# machines as the port should be treated by OVS agent and not by
|
||||
# external party
|
||||
interface_config = cfg.ConfigOpts()
|
||||
interface_config.register_opts(interface.OPTS)
|
||||
config.register_interface_opts(interface_config)
|
||||
ovs_interface = interface.OVSInterfaceDriver(interface_config)
|
||||
ovs_interface.plug_new(
|
||||
None,
|
||||
|
@ -70,8 +70,8 @@ class OVSAgentTestFramework(base.BaseOVSLinuxTestCase):
|
||||
def _get_config_opts(self):
|
||||
config = cfg.ConfigOpts()
|
||||
config.register_opts(common_config.core_opts)
|
||||
config.register_opts(interface.OPTS)
|
||||
ovs_conf.register_ovs_agent_opts(config)
|
||||
agent_config.register_interface_opts(config)
|
||||
agent_config.register_interface_driver_opts_helper(config)
|
||||
agent_config.register_agent_state_opts_helper(config)
|
||||
ext_manager.register_opts(config)
|
||||
|
@ -16,7 +16,6 @@ import mock
|
||||
from oslo_config import cfg
|
||||
|
||||
from neutron.agent.linux import dhcp
|
||||
from neutron.agent.linux import interface
|
||||
from neutron.agent.linux import ip_lib
|
||||
from neutron.common import utils as common_utils
|
||||
from neutron.conf.agent import common as config
|
||||
@ -31,8 +30,8 @@ class TestDhcp(functional_base.BaseSudoTestCase):
|
||||
def setUp(self):
|
||||
super(TestDhcp, self).setUp()
|
||||
conf = cfg.ConfigOpts()
|
||||
conf.register_opts(config.INTERFACE_DRIVER_OPTS)
|
||||
conf.register_opts(interface.OPTS)
|
||||
config.register_interface_driver_opts_helper(conf)
|
||||
config.register_interface_opts(conf)
|
||||
conf.register_opts(common_conf.core_opts)
|
||||
conf.register_opts(dhcp_conf.DHCP_AGENT_OPTS)
|
||||
conf.set_override('interface_driver', 'openvswitch')
|
||||
|
@ -23,6 +23,7 @@ from neutron.agent.linux import interface
|
||||
from neutron.agent.linux import ip_lib
|
||||
from neutron.common import exceptions
|
||||
from neutron.common import utils
|
||||
from neutron.conf.agent import common as config
|
||||
from neutron.tests.common import net_helpers
|
||||
from neutron.tests.functional.agent.linux import base as linux_base
|
||||
from neutron.tests.functional import base
|
||||
@ -74,7 +75,7 @@ class OVSInterfaceDriverTestCase(linux_base.BaseOVSLinuxTestCase,
|
||||
def setUp(self):
|
||||
super(OVSInterfaceDriverTestCase, self).setUp()
|
||||
conf = cfg.ConfigOpts()
|
||||
conf.register_opts(interface.OPTS)
|
||||
config.register_interface_opts(conf)
|
||||
self.interface = interface.OVSInterfaceDriver(conf)
|
||||
self.bridge = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
|
||||
|
||||
@ -130,7 +131,7 @@ class BridgeInterfaceDriverTestCase(base.BaseSudoTestCase,
|
||||
def setUp(self):
|
||||
super(BridgeInterfaceDriverTestCase, self).setUp()
|
||||
conf = cfg.ConfigOpts()
|
||||
conf.register_opts(interface.OPTS)
|
||||
config.register_interface_opts(conf)
|
||||
self.interface = interface.BridgeInterfaceDriver(conf)
|
||||
self.bridge = self.useFixture(net_helpers.LinuxBridgeFixture()).bridge
|
||||
|
||||
|
@ -23,7 +23,6 @@ from oslo_log import log as logging
|
||||
from oslo_utils import importutils
|
||||
import testtools
|
||||
|
||||
from neutron.agent.linux import interface
|
||||
from neutron.agent.linux import ip_lib
|
||||
from neutron.common import utils
|
||||
from neutron.conf.agent import common as config
|
||||
@ -49,7 +48,7 @@ class IpLibTestFramework(functional_base.BaseSudoTestCase):
|
||||
cfg.CONF.set_override(
|
||||
'interface_driver',
|
||||
'neutron.agent.linux.interface.OVSInterfaceDriver')
|
||||
cfg.CONF.register_opts(interface.OPTS)
|
||||
config.register_interface_opts()
|
||||
self.driver = importutils.import_object(cfg.CONF.interface_driver,
|
||||
cfg.CONF)
|
||||
|
||||
|
@ -27,7 +27,7 @@ class TestLoadInterfaceDriver(base.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(TestLoadInterfaceDriver, self).setUp()
|
||||
self.conf = config.setup_conf()
|
||||
self.conf.register_opts(interface.OPTS)
|
||||
config.register_interface_opts(self.conf)
|
||||
config.register_interface_driver_opts_helper(self.conf)
|
||||
|
||||
def test_load_interface_driver_not_set(self):
|
||||
|
@ -262,7 +262,7 @@ class TestDhcpAgent(base.BaseTestCase):
|
||||
cfg.CONF.register_opts(dhcp_config.DHCP_AGENT_OPTS)
|
||||
config.register_interface_driver_opts_helper(cfg.CONF)
|
||||
config.register_agent_state_opts_helper(cfg.CONF)
|
||||
cfg.CONF.register_opts(interface.OPTS)
|
||||
config.register_interface_opts(cfg.CONF)
|
||||
common_config.init(sys.argv[1:])
|
||||
agent_mgr = dhcp_agent.DhcpAgentWithStateReport(
|
||||
'testhost')
|
||||
|
@ -41,7 +41,6 @@ from neutron.agent.l3 import namespaces
|
||||
from neutron.agent.l3 import router_info as l3router
|
||||
from neutron.agent.l3 import router_processing_queue
|
||||
from neutron.agent.linux import dibbler
|
||||
from neutron.agent.linux import external_process
|
||||
from neutron.agent.linux import interface
|
||||
from neutron.agent.linux import iptables_manager
|
||||
from neutron.agent.linux import pd
|
||||
@ -77,10 +76,10 @@ class BasicRouterOperationsFramework(base.BaseTestCase):
|
||||
agent_config.register_interface_driver_opts_helper(self.conf)
|
||||
agent_config.register_process_monitor_opts(self.conf)
|
||||
agent_config.register_availability_zone_opts_helper(self.conf)
|
||||
self.conf.register_opts(interface.OPTS)
|
||||
self.conf.register_opts(external_process.OPTS)
|
||||
self.conf.register_opts(pd.OPTS)
|
||||
self.conf.register_opts(ra.OPTS)
|
||||
agent_config.register_interface_opts(self.conf)
|
||||
agent_config.register_external_process_opts(self.conf)
|
||||
agent_config.register_pd_opts(self.conf)
|
||||
agent_config.register_ra_opts(self.conf)
|
||||
self.conf.set_override('interface_driver',
|
||||
'neutron.agent.linux.interface.NullDriver')
|
||||
self.conf.set_override('state_path', cfg.CONF.state_path)
|
||||
|
@ -25,7 +25,6 @@ from neutron.agent.l3 import dvr_edge_router as dvr_edge_rtr
|
||||
from neutron.agent.l3 import dvr_local_router as dvr_router
|
||||
from neutron.agent.l3 import link_local_allocator as lla
|
||||
from neutron.agent.l3 import router_info
|
||||
from neutron.agent.linux import external_process
|
||||
from neutron.agent.linux import interface
|
||||
from neutron.agent.linux import ip_lib
|
||||
from neutron.common import constants as n_const
|
||||
@ -55,8 +54,8 @@ class TestDvrRouterOperations(base.BaseTestCase):
|
||||
ha_conf.register_l3_agent_ha_opts(self.conf)
|
||||
agent_config.register_interface_driver_opts_helper(self.conf)
|
||||
agent_config.register_process_monitor_opts(self.conf)
|
||||
self.conf.register_opts(interface.OPTS)
|
||||
self.conf.register_opts(external_process.OPTS)
|
||||
agent_config.register_interface_opts(self.conf)
|
||||
agent_config.register_external_process_opts(self.conf)
|
||||
self.conf.set_override('interface_driver',
|
||||
'neutron.agent.linux.interface.NullDriver')
|
||||
self.conf.set_override('state_path', cfg.CONF.state_path)
|
||||
|
@ -25,7 +25,6 @@ from oslo_utils import fileutils
|
||||
import testtools
|
||||
|
||||
from neutron.agent.linux import dhcp
|
||||
from neutron.agent.linux import external_process
|
||||
from neutron.common import constants as n_const
|
||||
from neutron.conf.agent import common as config
|
||||
from neutron.conf.agent import dhcp as dhcp_config
|
||||
@ -940,7 +939,7 @@ class TestConfBase(base.BaseTestCase):
|
||||
self.conf.register_opts(base_config.core_opts)
|
||||
self.conf.register_opts(dhcp_config.DHCP_OPTS)
|
||||
self.conf.register_opts(dhcp_config.DNSMASQ_OPTS)
|
||||
self.conf.register_opts(external_process.OPTS)
|
||||
config.register_external_process_opts(self.conf)
|
||||
config.register_interface_driver_opts_helper(self.conf)
|
||||
|
||||
|
||||
|
@ -58,7 +58,7 @@ class TestBase(base.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(TestBase, self).setUp()
|
||||
self.conf = config.setup_conf()
|
||||
self.conf.register_opts(interface.OPTS)
|
||||
config.register_interface_opts(self.conf)
|
||||
self.ip_dev_p = mock.patch.object(ip_lib, 'IPDevice')
|
||||
self.ip_dev = self.ip_dev_p.start()
|
||||
self.ip_p = mock.patch.object(ip_lib, 'IPWrapper')
|
||||
|
@ -35,7 +35,7 @@ class MyApp(object):
|
||||
class TestDebugCommands(base.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(TestDebugCommands, self).setUp()
|
||||
cfg.CONF.register_opts(interface.OPTS)
|
||||
config.register_interface_opts()
|
||||
cfg.CONF.register_opts(config.EXT_NET_BRIDGE_OPTS)
|
||||
common_config.init([])
|
||||
config.register_interface_driver_opts_helper(cfg.CONF)
|
||||
|
Loading…
Reference in New Issue
Block a user