summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsindhu devale <sindhu.devale@intel.com>2016-07-27 04:39:07 +0000
committerBrian Haley <bhaley@redhat.com>2017-08-25 10:41:39 -0400
commit51ca6837974a19369504f7cba7749d4e01d25a1f (patch)
treed43e9b2ad03cc2fa6919bc3405420bb5f9ba2845
parent1ce7b689b3f07017e733043276dc76feada2e7b8 (diff)
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
Notes
Notes (review): Verified+1: Mellanox CI <mlnx-openstack-ci@dev.mellanox.co.il> Code-Review+2: Kevin Benton <kevin@benton.pub> Code-Review+2: Armando Migliaccio <armamig@gmail.com> Workflow+1: Armando Migliaccio <armamig@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Wed, 13 Sep 2017 00:33:56 +0000 Reviewed-on: https://review.openstack.org/347867 Project: openstack/neutron Branch: refs/heads/master
-rw-r--r--neutron/agent/common/ip_lib.py6
-rw-r--r--neutron/agent/dhcp_agent.py3
-rw-r--r--neutron/agent/l3_agent.py12
-rw-r--r--neutron/agent/linux/external_process.py12
-rw-r--r--neutron/agent/linux/interface.py15
-rw-r--r--neutron/agent/linux/ip_lib.py5
-rw-r--r--neutron/agent/linux/pd.py8
-rw-r--r--neutron/agent/linux/pd_driver.py15
-rw-r--r--neutron/agent/linux/ra.py14
-rw-r--r--neutron/agent/ovsdb/api.py23
-rw-r--r--neutron/agent/windows/ip_lib.py2
-rw-r--r--neutron/cmd/netns_cleanup.py4
-rw-r--r--neutron/cmd/ovs_cleanup.py4
-rw-r--r--neutron/conf/agent/common.py71
-rw-r--r--neutron/conf/agent/linux.py28
-rw-r--r--neutron/conf/agent/ovsdb_api.py42
-rw-r--r--neutron/conf/agent/windows.py17
-rw-r--r--neutron/debug/shell.py3
-rw-r--r--neutron/opts.py16
-rw-r--r--neutron/services/metering/drivers/iptables/iptables_driver.py3
-rw-r--r--neutron/tests/common/net_helpers.py2
-rw-r--r--neutron/tests/functional/agent/l2/base.py2
-rw-r--r--neutron/tests/functional/agent/linux/test_dhcp.py5
-rw-r--r--neutron/tests/functional/agent/linux/test_interface.py5
-rw-r--r--neutron/tests/functional/agent/linux/test_ip_lib.py3
-rw-r--r--neutron/tests/unit/agent/common/test_utils.py2
-rw-r--r--neutron/tests/unit/agent/dhcp/test_agent.py2
-rw-r--r--neutron/tests/unit/agent/l3/test_agent.py9
-rw-r--r--neutron/tests/unit/agent/l3/test_dvr_local_router.py5
-rw-r--r--neutron/tests/unit/agent/linux/test_dhcp.py3
-rw-r--r--neutron/tests/unit/agent/linux/test_interface.py2
-rw-r--r--neutron/tests/unit/debug/test_commands.py2
32 files changed, 204 insertions, 141 deletions
diff --git a/neutron/agent/common/ip_lib.py b/neutron/agent/common/ip_lib.py
index ee129f4..abe9c40 100644
--- a/neutron/agent/common/ip_lib.py
+++ b/neutron/agent/common/ip_lib.py
@@ -17,11 +17,13 @@ import os
17 17
18if os.name == 'nt': 18if os.name == 'nt':
19 from neutron.agent.windows import ip_lib 19 from neutron.agent.windows import ip_lib
20 from neutron.conf.agent import windows
21 OPTS = windows.IP_LIB_OPTS_WINDOWS
20else: 22else:
21 from neutron.agent.linux import ip_lib 23 from neutron.agent.linux import ip_lib
24 from neutron.conf.agent import linux
25 OPTS = linux.IP_LIB_OPTS_LINUX
22 26
23 27
24OPTS = ip_lib.OPTS
25
26IPWrapper = ip_lib.IPWrapper 28IPWrapper = ip_lib.IPWrapper
27IPDevice = ip_lib.IPDevice 29IPDevice = ip_lib.IPDevice
diff --git a/neutron/agent/dhcp_agent.py b/neutron/agent/dhcp_agent.py
index 6096a13..cfb1576 100644
--- a/neutron/agent/dhcp_agent.py
+++ b/neutron/agent/dhcp_agent.py
@@ -19,7 +19,6 @@ import sys
19from oslo_config import cfg 19from oslo_config import cfg
20from oslo_service import service 20from oslo_service import service
21 21
22from neutron.agent.linux import interface
23from neutron.common import config as common_config 22from neutron.common import config as common_config
24from neutron.common import topics 23from neutron.common import topics
25from neutron.conf.agent import common as config 24from neutron.conf.agent import common as config
@@ -34,7 +33,7 @@ def register_options(conf):
34 config.register_availability_zone_opts_helper(conf) 33 config.register_availability_zone_opts_helper(conf)
35 dhcp_config.register_agent_dhcp_opts(conf) 34 dhcp_config.register_agent_dhcp_opts(conf)
36 meta_conf.register_meta_conf_opts(meta_conf.SHARED_OPTS, conf) 35 meta_conf.register_meta_conf_opts(meta_conf.SHARED_OPTS, conf)
37 conf.register_opts(interface.OPTS) 36 config.register_interface_opts(conf)
38 37
39 38
40def main(): 39def main():
diff --git a/neutron/agent/l3_agent.py b/neutron/agent/l3_agent.py
index 0c8c052..c88195f 100644
--- a/neutron/agent/l3_agent.py
+++ b/neutron/agent/l3_agent.py
@@ -19,10 +19,6 @@ import sys
19from oslo_config import cfg 19from oslo_config import cfg
20from oslo_service import service 20from oslo_service import service
21 21
22from neutron.agent.linux import external_process
23from neutron.agent.linux import interface
24from neutron.agent.linux import pd
25from neutron.agent.linux import ra
26from neutron.common import config as common_config 22from neutron.common import config as common_config
27from neutron.common import topics 23from neutron.common import topics
28from neutron.conf.agent import common as config 24from neutron.conf.agent import common as config
@@ -38,10 +34,10 @@ def register_opts(conf):
38 meta_conf.register_meta_conf_opts(meta_conf.SHARED_OPTS, conf) 34 meta_conf.register_meta_conf_opts(meta_conf.SHARED_OPTS, conf)
39 config.register_interface_driver_opts_helper(conf) 35 config.register_interface_driver_opts_helper(conf)
40 config.register_agent_state_opts_helper(conf) 36 config.register_agent_state_opts_helper(conf)
41 conf.register_opts(interface.OPTS) 37 config.register_interface_opts(conf)
42 conf.register_opts(external_process.OPTS) 38 config.register_external_process_opts(conf)
43 conf.register_opts(pd.OPTS) 39 config.register_pddriver_opts(conf)
44 conf.register_opts(ra.OPTS) 40 config.register_ra_opts(conf)
45 config.register_availability_zone_opts_helper(conf) 41 config.register_availability_zone_opts_helper(conf)
46 42
47 43
diff --git a/neutron/agent/linux/external_process.py b/neutron/agent/linux/external_process.py
index bd32fca..b1d9c3c 100644
--- a/neutron/agent/linux/external_process.py
+++ b/neutron/agent/linux/external_process.py
@@ -24,23 +24,15 @@ from oslo_utils import fileutils
24import psutil 24import psutil
25import six 25import six
26 26
27from neutron._i18n import _
28from neutron.agent.linux import ip_lib 27from neutron.agent.linux import ip_lib
29from neutron.agent.linux import utils 28from neutron.agent.linux import utils
30
31from neutron.conf.agent import common as agent_cfg 29from neutron.conf.agent import common as agent_cfg
32 30
33LOG = logging.getLogger(__name__)
34
35 31
36OPTS = [ 32LOG = logging.getLogger(__name__)
37 cfg.StrOpt('external_pids',
38 default='$state_path/external/pids',
39 help=_('Location to store child pid files')),
40]
41 33
42 34
43cfg.CONF.register_opts(OPTS) 35agent_cfg.register_external_process_opts()
44agent_cfg.register_process_monitor_opts(cfg.CONF) 36agent_cfg.register_process_monitor_opts(cfg.CONF)
45 37
46 38
diff --git a/neutron/agent/linux/interface.py b/neutron/agent/linux/interface.py
index 88d6e67..f451575 100644
--- a/neutron/agent/linux/interface.py
+++ b/neutron/agent/linux/interface.py
@@ -18,32 +18,17 @@ import time
18 18
19import netaddr 19import netaddr
20from neutron_lib import constants 20from neutron_lib import constants
21from oslo_config import cfg
22from oslo_log import log as logging 21from oslo_log import log as logging
23import six 22import six
24 23
25from neutron._i18n import _
26from neutron.agent.common import ovs_lib 24from neutron.agent.common import ovs_lib
27from neutron.agent.linux import ip_lib 25from neutron.agent.linux import ip_lib
28from neutron.agent.linux import utils 26from neutron.agent.linux import utils
29from neutron.common import constants as n_const 27from neutron.common import constants as n_const
30from neutron.common import exceptions 28from neutron.common import exceptions
31 29
32
33LOG = logging.getLogger(__name__) 30LOG = logging.getLogger(__name__)
34 31
35OPTS = [
36 cfg.StrOpt('ovs_integration_bridge',
37 default='br-int',
38 help=_('Name of Open vSwitch bridge to use')),
39 cfg.BoolOpt('ovs_use_veth',
40 default=False,
41 help=_('Uses veth for an OVS interface or not. '
42 'Support kernels with limited namespace support '
43 '(e.g. RHEL 6.5) so long as ovs_use_veth is set to '
44 'True.')),
45]
46
47 32
48def _get_veth(name1, name2, namespace2): 33def _get_veth(name1, name2, namespace2):
49 return (ip_lib.IPDevice(name1), 34 return (ip_lib.IPDevice(name1),
diff --git a/neutron/agent/linux/ip_lib.py b/neutron/agent/linux/ip_lib.py
index 18bb6a1..8f501d9 100644
--- a/neutron/agent/linux/ip_lib.py
+++ b/neutron/agent/linux/ip_lib.py
@@ -35,11 +35,6 @@ from neutron.privileged.agent.linux import ip_lib as privileged
35 35
36LOG = logging.getLogger(__name__) 36LOG = logging.getLogger(__name__)
37 37
38OPTS = [
39 cfg.BoolOpt('ip_lib_force_root',
40 default=False,
41 help=_('Force ip_lib calls to use the root helper')),
42]
43 38
44IP_NONLOCAL_BIND = 'net.ipv4.ip_nonlocal_bind' 39IP_NONLOCAL_BIND = 'net.ipv4.ip_nonlocal_bind'
45 40
diff --git a/neutron/agent/linux/pd.py b/neutron/agent/linux/pd.py
index 02ef2e8..ef66587 100644
--- a/neutron/agent/linux/pd.py
+++ b/neutron/agent/linux/pd.py
@@ -21,24 +21,16 @@ from neutron_lib.callbacks import events
21from neutron_lib.callbacks import registry 21from neutron_lib.callbacks import registry
22from neutron_lib.callbacks import resources 22from neutron_lib.callbacks import resources
23from neutron_lib import constants as n_const 23from neutron_lib import constants as n_const
24from oslo_config import cfg
25from oslo_log import log as logging 24from oslo_log import log as logging
26from oslo_utils import netutils 25from oslo_utils import netutils
27import six 26import six
28from stevedore import driver 27from stevedore import driver
29 28
30from neutron._i18n import _
31from neutron.common import constants as l3_constants 29from neutron.common import constants as l3_constants
32from neutron.common import utils 30from neutron.common import utils
33 31
34LOG = logging.getLogger(__name__) 32LOG = logging.getLogger(__name__)
35 33
36OPTS = [
37 cfg.StrOpt('pd_dhcp_driver',
38 default='dibbler',
39 help=_('Service to handle DHCPv6 Prefix delegation.')),
40]
41
42 34
43class PrefixDelegation(object): 35class PrefixDelegation(object):
44 def __init__(self, context, pmon, intf_driver, notifier, pd_update_cb, 36 def __init__(self, context, pmon, intf_driver, notifier, pd_update_cb,
diff --git a/neutron/agent/linux/pd_driver.py b/neutron/agent/linux/pd_driver.py
index 2aabacd..6f7d28f 100644
--- a/neutron/agent/linux/pd_driver.py
+++ b/neutron/agent/linux/pd_driver.py
@@ -15,22 +15,11 @@
15 15
16import abc 16import abc
17 17
18from oslo_config import cfg
19import six 18import six
20 19
21from neutron._i18n import _ 20from neutron.conf.agent import common as agent_conf
22 21
23OPTS = [ 22agent_conf.register_pddriver_opts()
24 cfg.StrOpt('pd_confs',
25 default='$state_path/pd',
26 help=_('Location to store IPv6 PD files.')),
27 cfg.StrOpt('vendor_pen',
28 default='8888',
29 help=_("A decimal value as Vendor's Registered Private "
30 "Enterprise Number as required by RFC3315 DUID-EN.")),
31]
32
33cfg.CONF.register_opts(OPTS)
34 23
35 24
36@six.add_metaclass(abc.ABCMeta) 25@six.add_metaclass(abc.ABCMeta)
diff --git a/neutron/agent/linux/ra.py b/neutron/agent/linux/ra.py
index 89e9a24..00b0990 100644
--- a/neutron/agent/linux/ra.py
+++ b/neutron/agent/linux/ra.py
@@ -19,16 +19,13 @@ import jinja2
19import netaddr 19import netaddr
20from neutron_lib import constants 20from neutron_lib import constants
21from neutron_lib.utils import file as file_utils 21from neutron_lib.utils import file as file_utils
22from oslo_config import cfg
23from oslo_log import log as logging 22from oslo_log import log as logging
24import six 23import six
25 24
26from neutron._i18n import _
27from neutron.agent.linux import external_process 25from neutron.agent.linux import external_process
28from neutron.agent.linux import utils 26from neutron.agent.linux import utils
29from neutron.common import constants as n_const 27from neutron.common import constants as n_const
30 28
31
32RADVD_SERVICE_NAME = 'radvd' 29RADVD_SERVICE_NAME = 'radvd'
33RADVD_SERVICE_CMD = 'radvd' 30RADVD_SERVICE_CMD = 'radvd'
34# We can configure max of 3 DNS servers in radvd RDNSS section. 31# We can configure max of 3 DNS servers in radvd RDNSS section.
@@ -36,17 +33,6 @@ MAX_RDNSS_ENTRIES = 3
36 33
37LOG = logging.getLogger(__name__) 34LOG = logging.getLogger(__name__)
38 35
39OPTS = [
40 cfg.StrOpt('ra_confs',
41 default='$state_path/ra',
42 help=_('Location to store IPv6 RA config files')),
43 cfg.IntOpt('min_rtr_adv_interval',
44 default=30,
45 help=_('MinRtrAdvInterval setting for radvd.conf')),
46 cfg.IntOpt('max_rtr_adv_interval',
47 default=100,
48 help=_('MaxRtrAdvInterval setting for radvd.conf')),
49]
50 36
51CONFIG_TEMPLATE = jinja2.Template("""interface {{ interface_name }} 37CONFIG_TEMPLATE = jinja2.Template("""interface {{ interface_name }}
52{ 38{
diff --git a/neutron/agent/ovsdb/api.py b/neutron/agent/ovsdb/api.py
index 81fc59c..36205b6 100644
--- a/neutron/agent/ovsdb/api.py
+++ b/neutron/agent/ovsdb/api.py
@@ -21,7 +21,7 @@ from oslo_utils import importutils
21from ovsdbapp import api 21from ovsdbapp import api
22from ovsdbapp import exceptions 22from ovsdbapp import exceptions
23 23
24from neutron._i18n import _ 24from neutron.conf.agent import ovsdb_api
25 25
26API = moves.moved_class(api.API, 'API', __name__) 26API = moves.moved_class(api.API, 'API', __name__)
27Command = moves.moved_class(api.Command, 'Command', __name__) 27Command = moves.moved_class(api.Command, 'Command', __name__)
@@ -29,31 +29,14 @@ Transaction = moves.moved_class(api.Transaction, 'Transaction', __name__)
29TimeoutException = moves.moved_class(exceptions.TimeoutException, 29TimeoutException = moves.moved_class(exceptions.TimeoutException,
30 'TimeoutException', __name__) 30 'TimeoutException', __name__)
31 31
32interface_map = {
33 'vsctl': 'neutron.agent.ovsdb.impl_vsctl',
34 'native': 'neutron.agent.ovsdb.impl_idl',
35}
36 32
37OPTS = [ 33ovsdb_api.register_ovsdb_api_opts()
38 cfg.StrOpt('ovsdb_interface',
39 choices=interface_map.keys(),
40 default='native',
41 help=_('The interface for interacting with the OVSDB')),
42 cfg.StrOpt('ovsdb_connection',
43 default='tcp:127.0.0.1:6640',
44 help=_('The connection string for the OVSDB backend. '
45 'Will be used by ovsdb-client when monitoring and '
46 'used for the all ovsdb commands when native '
47 'ovsdb_interface is enabled'
48 ))
49]
50cfg.CONF.register_opts(OPTS, 'OVS')
51 34
52 35
53def from_config(context, iface_name=None): 36def from_config(context, iface_name=None):
54 """Return the configured OVSDB API implementation""" 37 """Return the configured OVSDB API implementation"""
55 iface = importutils.import_module( 38 iface = importutils.import_module(
56 interface_map[iface_name or cfg.CONF.OVS.ovsdb_interface]) 39 ovsdb_api.interface_map[iface_name or cfg.CONF.OVS.ovsdb_interface])
57 return iface.api_factory(context) 40 return iface.api_factory(context)
58 41
59 42
diff --git a/neutron/agent/windows/ip_lib.py b/neutron/agent/windows/ip_lib.py
index bae94e4..030f2a0 100644
--- a/neutron/agent/windows/ip_lib.py
+++ b/neutron/agent/windows/ip_lib.py
@@ -19,8 +19,6 @@ from oslo_log import log as logging
19 19
20LOG = logging.getLogger(__name__) 20LOG = logging.getLogger(__name__)
21 21
22OPTS = []
23
24 22
25class IPWrapper(object): 23class IPWrapper(object):
26 24
diff --git a/neutron/cmd/netns_cleanup.py b/neutron/cmd/netns_cleanup.py
index 247f6e5..729fa58 100644
--- a/neutron/cmd/netns_cleanup.py
+++ b/neutron/cmd/netns_cleanup.py
@@ -29,7 +29,6 @@ from neutron.agent.l3 import dvr_snat_ns
29from neutron.agent.l3 import namespaces 29from neutron.agent.l3 import namespaces
30from neutron.agent.linux import dhcp 30from neutron.agent.linux import dhcp
31from neutron.agent.linux import external_process 31from neutron.agent.linux import external_process
32from neutron.agent.linux import interface
33from neutron.agent.linux import ip_lib 32from neutron.agent.linux import ip_lib
34from neutron.agent.linux import utils 33from neutron.agent.linux import utils
35from neutron.common import config 34from neutron.common import config
@@ -37,7 +36,6 @@ from neutron.conf.agent import cmd
37from neutron.conf.agent import common as agent_config 36from neutron.conf.agent import common as agent_config
38from neutron.conf.agent import dhcp as dhcp_config 37from neutron.conf.agent import dhcp as dhcp_config
39 38
40
41LOG = logging.getLogger(__name__) 39LOG = logging.getLogger(__name__)
42LB_NS_PREFIX = 'qlbaas-' 40LB_NS_PREFIX = 'qlbaas-'
43NS_PREFIXES = { 41NS_PREFIXES = {
@@ -73,7 +71,7 @@ def setup_conf():
73 cmd.register_cmd_opts(cmd.netns_opts, conf) 71 cmd.register_cmd_opts(cmd.netns_opts, conf)
74 agent_config.register_interface_driver_opts_helper(conf) 72 agent_config.register_interface_driver_opts_helper(conf)
75 dhcp_config.register_agent_dhcp_opts(conf) 73 dhcp_config.register_agent_dhcp_opts(conf)
76 conf.register_opts(interface.OPTS) 74 agent_config.register_interface_opts()
77 return conf 75 return conf
78 76
79 77
diff --git a/neutron/cmd/ovs_cleanup.py b/neutron/cmd/ovs_cleanup.py
index dc53a6c..8757a37 100644
--- a/neutron/cmd/ovs_cleanup.py
+++ b/neutron/cmd/ovs_cleanup.py
@@ -17,7 +17,6 @@ from oslo_config import cfg
17from oslo_log import log as logging 17from oslo_log import log as logging
18 18
19from neutron.agent.common import ovs_lib 19from neutron.agent.common import ovs_lib
20from neutron.agent.linux import interface
21from neutron.agent.linux import ip_lib 20from neutron.agent.linux import ip_lib
22from neutron.common import config 21from neutron.common import config
23from neutron.conf.agent import cmd 22from neutron.conf.agent import cmd
@@ -25,7 +24,6 @@ from neutron.conf.agent import common as agent_config
25from neutron.conf.agent.l3 import config as l3_config 24from neutron.conf.agent.l3 import config as l3_config
26from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants 25from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants
27 26
28
29LOG = logging.getLogger(__name__) 27LOG = logging.getLogger(__name__)
30 28
31 29
@@ -39,8 +37,8 @@ def setup_conf():
39 conf = cfg.CONF 37 conf = cfg.CONF
40 cmd.register_cmd_opts(cmd.ovs_opts, conf) 38 cmd.register_cmd_opts(cmd.ovs_opts, conf)
41 l3_config.register_l3_agent_config_opts(l3_config.OPTS, conf) 39 l3_config.register_l3_agent_config_opts(l3_config.OPTS, conf)
42 conf.register_opts(interface.OPTS)
43 agent_config.register_interface_driver_opts_helper(conf) 40 agent_config.register_interface_driver_opts_helper(conf)
41 agent_config.register_interface_opts()
44 return conf 42 return conf
45 43
46 44
diff --git a/neutron/conf/agent/common.py b/neutron/conf/agent/common.py
index 33dedcc..6f0fd91 100644
--- a/neutron/conf/agent/common.py
+++ b/neutron/conf/agent/common.py
@@ -23,6 +23,57 @@ from neutron._i18n import _
23from neutron.common import config 23from neutron.common import config
24 24
25 25
26EXTERNAL_PROCESS_OPTS = [
27 cfg.StrOpt('external_pids',
28 default='$state_path/external/pids',
29 help=_('Location to store child pid files')),
30]
31
32
33PD_OPTS = [
34 cfg.StrOpt('pd_dhcp_driver',
35 default='dibbler',
36 help=_('Service to handle DHCPv6 Prefix delegation.')),
37]
38
39
40PD_DRIVER_OPTS = [
41 cfg.StrOpt('pd_confs',
42 default='$state_path/pd',
43 help=_('Location to store IPv6 PD files.')),
44 cfg.StrOpt('vendor_pen',
45 default='8888',
46 help=_("A decimal value as Vendor's Registered Private "
47 "Enterprise Number as required by RFC3315 DUID-EN.")),
48]
49
50
51INTERFACE_OPTS = [
52 cfg.StrOpt('ovs_integration_bridge',
53 default='br-int',
54 help=_('Name of Open vSwitch bridge to use')),
55 cfg.BoolOpt('ovs_use_veth',
56 default=False,
57 help=_('Uses veth for an OVS interface or not. '
58 'Support kernels with limited namespace support '
59 '(e.g. RHEL 6.5) so long as ovs_use_veth is set to '
60 'True.')),
61]
62
63
64RA_OPTS = [
65 cfg.StrOpt('ra_confs',
66 default='$state_path/ra',
67 help=_('Location to store IPv6 RA config files')),
68 cfg.IntOpt('min_rtr_adv_interval',
69 default=30,
70 help=_('MinRtrAdvInterval setting for radvd.conf')),
71 cfg.IntOpt('max_rtr_adv_interval',
72 default=100,
73 help=_('MaxRtrAdvInterval setting for radvd.conf')),
74]
75
76
26ROOT_HELPER_OPTS = [ 77ROOT_HELPER_OPTS = [
27 cfg.StrOpt('root_helper', default='sudo', 78 cfg.StrOpt('root_helper', default='sudo',
28 help=_("Root helper application. " 79 help=_("Root helper application. "
@@ -131,6 +182,26 @@ def get_log_args(conf, log_file_name, **kwargs):
131 return cmd_args 182 return cmd_args
132 183
133 184
185def register_external_process_opts(cfg=cfg.CONF):
186 cfg.register_opts(EXTERNAL_PROCESS_OPTS)
187
188
189def register_pd_opts(cfg=cfg.CONF):
190 cfg.register_opts(PD_OPTS)
191
192
193def register_pddriver_opts(cfg=cfg.CONF):
194 cfg.register_opts(PD_DRIVER_OPTS)
195
196
197def register_interface_opts(cfg=cfg.CONF):
198 cfg.register_opts(INTERFACE_OPTS)
199
200
201def register_ra_opts(cfg=cfg.CONF):
202 cfg.register_opts(RA_OPTS)
203
204
134def register_root_helper(conf=cfg.CONF): 205def register_root_helper(conf=cfg.CONF):
135 conf.register_opts(ROOT_HELPER_OPTS, 'AGENT') 206 conf.register_opts(ROOT_HELPER_OPTS, 'AGENT')
136 207
diff --git a/neutron/conf/agent/linux.py b/neutron/conf/agent/linux.py
new file mode 100644
index 0000000..aaacfcd
--- /dev/null
+++ b/neutron/conf/agent/linux.py
@@ -0,0 +1,28 @@
1# Copyright 2017 OpenStack Foundation
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
16from neutron._i18n import _
17
18from oslo_config import cfg
19
20IP_LIB_OPTS_LINUX = [
21 cfg.BoolOpt('ip_lib_force_root',
22 default=False,
23 help=_('Force ip_lib calls to use the root helper')),
24]
25
26
27def register_iplib_opts(cfg=cfg.CONF):
28 cfg.register_opts(IP_LIB_OPTS_LINUX)
diff --git a/neutron/conf/agent/ovsdb_api.py b/neutron/conf/agent/ovsdb_api.py
new file mode 100644
index 0000000..b218d0c
--- /dev/null
+++ b/neutron/conf/agent/ovsdb_api.py
@@ -0,0 +1,42 @@
1# Copyright 2017 OpenStack Foundation
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
16from neutron._i18n import _
17from oslo_config import cfg
18
19
20interface_map = {
21 'vsctl': 'neutron.agent.ovsdb.impl_vsctl',
22 'native': 'neutron.agent.ovsdb.impl_idl',
23}
24
25
26API_OPTS = [
27 cfg.StrOpt('ovsdb_interface',
28 choices=interface_map.keys(),
29 default='native',
30 help=_('The interface for interacting with the OVSDB')),
31 cfg.StrOpt('ovsdb_connection',
32 default='tcp:127.0.0.1:6640',
33 help=_('The connection string for the OVSDB backend. '
34 'Will be used by ovsdb-client when monitoring and '
35 'used for the all ovsdb commands when native '
36 'ovsdb_interface is enabled'
37 ))
38]
39
40
41def register_ovsdb_api_opts(cfg=cfg.CONF):
42 cfg.register_opts(API_OPTS, 'OVS')
diff --git a/neutron/conf/agent/windows.py b/neutron/conf/agent/windows.py
new file mode 100644
index 0000000..30be1cf
--- /dev/null
+++ b/neutron/conf/agent/windows.py
@@ -0,0 +1,17 @@
1# Copyright 2017 OpenStack Foundation
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
16
17IP_LIB_OPTS_WINDOWS = []
diff --git a/neutron/debug/shell.py b/neutron/debug/shell.py
index fafa93e..adc43ce 100644
--- a/neutron/debug/shell.py
+++ b/neutron/debug/shell.py
@@ -20,7 +20,6 @@ from oslo_utils import importutils
20 20
21from neutron._i18n import _ 21from neutron._i18n import _
22from neutron.agent.common import utils 22from neutron.agent.common import utils
23from neutron.agent.linux import interface
24from neutron.conf.agent import common as config 23from neutron.conf.agent import common as config
25from neutron.debug import debug_agent 24from neutron.debug import debug_agent
26from neutronclient.common import exceptions as exc 25from neutronclient.common import exceptions as exc
@@ -71,7 +70,7 @@ class NeutronDebugShell(shell.NeutronShell):
71 _("You must provide a config file for bridge -" 70 _("You must provide a config file for bridge -"
72 " either --config-file or env[NEUTRON_TEST_CONFIG_FILE]")) 71 " either --config-file or env[NEUTRON_TEST_CONFIG_FILE]"))
73 client = self.client_manager.neutron 72 client = self.client_manager.neutron
74 cfg.CONF.register_opts(interface.OPTS) 73 config.register_interface_opts()
75 cfg.CONF.register_opts(config.EXT_NET_BRIDGE_OPTS) 74 cfg.CONF.register_opts(config.EXT_NET_BRIDGE_OPTS)
76 config.register_interface_driver_opts_helper(cfg.CONF) 75 config.register_interface_driver_opts_helper(cfg.CONF)
77 cfg.CONF(['--config-file', self.options.config_file]) 76 cfg.CONF(['--config-file', self.options.config_file])
diff --git a/neutron/opts.py b/neutron/opts.py
index 1d54f2f..6fce03b 100644
--- a/neutron/opts.py
+++ b/neutron/opts.py
@@ -18,10 +18,6 @@ from keystoneauth1 import loading as ks_loading
18from oslo_config import cfg 18from oslo_config import cfg
19 19
20import neutron.agent.agent_extensions_manager 20import neutron.agent.agent_extensions_manager
21import neutron.agent.linux.interface
22import neutron.agent.linux.pd
23import neutron.agent.linux.ra
24import neutron.agent.ovsdb.api
25import neutron.agent.securitygroups_rpc 21import neutron.agent.securitygroups_rpc
26import neutron.common.cache_utils 22import neutron.common.cache_utils
27import neutron.conf.agent.agent_extensions_manager 23import neutron.conf.agent.agent_extensions_manager
@@ -29,8 +25,10 @@ import neutron.conf.agent.common
29import neutron.conf.agent.dhcp 25import neutron.conf.agent.dhcp
30import neutron.conf.agent.l3.config 26import neutron.conf.agent.l3.config
31import neutron.conf.agent.l3.ha 27import neutron.conf.agent.l3.ha
28import neutron.conf.agent.linux
32import neutron.conf.agent.metadata.config as meta_conf 29import neutron.conf.agent.metadata.config as meta_conf
33import neutron.conf.agent.ovs_conf 30import neutron.conf.agent.ovs_conf
31import neutron.conf.agent.ovsdb_api
34import neutron.conf.agent.xenapi_conf 32import neutron.conf.agent.xenapi_conf
35import neutron.conf.cache_utils 33import neutron.conf.cache_utils
36import neutron.conf.common 34import neutron.conf.common
@@ -146,12 +144,12 @@ def list_base_agent_opts():
146 return [ 144 return [
147 ('DEFAULT', 145 ('DEFAULT',
148 itertools.chain( 146 itertools.chain(
149 neutron.agent.linux.interface.OPTS, 147 neutron.conf.agent.common.INTERFACE_OPTS,
150 neutron.conf.agent.common.INTERFACE_DRIVER_OPTS, 148 neutron.conf.agent.common.INTERFACE_DRIVER_OPTS,
151 neutron.conf.agent.ovs_conf.OPTS) 149 neutron.conf.agent.ovs_conf.OPTS)
152 ), 150 ),
153 ('agent', neutron.conf.agent.common.AGENT_STATE_OPTS), 151 ('agent', neutron.conf.agent.common.AGENT_STATE_OPTS),
154 ('ovs', neutron.agent.ovsdb.api.OPTS), 152 ('ovs', neutron.conf.agent.ovsdb_api.API_OPTS),
155 ] 153 ]
156 154
157 155
@@ -196,8 +194,8 @@ def list_l3_agent_opts():
196 neutron.conf.agent.l3.config.OPTS, 194 neutron.conf.agent.l3.config.OPTS,
197 neutron.conf.service.service_opts, 195 neutron.conf.service.service_opts,
198 neutron.conf.agent.l3.ha.OPTS, 196 neutron.conf.agent.l3.ha.OPTS,
199 neutron.agent.linux.pd.OPTS, 197 neutron.conf.agent.common.PD_DRIVER_OPTS,
200 neutron.agent.linux.ra.OPTS) 198 neutron.conf.agent.common.RA_OPTS)
201 ), 199 ),
202 ('agent', 200 ('agent',
203 neutron.conf.agent.agent_extensions_manager.AGENT_EXT_MANAGER_OPTS), 201 neutron.conf.agent.agent_extensions_manager.AGENT_EXT_MANAGER_OPTS),
@@ -258,7 +256,7 @@ def list_ovs_opts():
258 ('ovs', 256 ('ovs',
259 itertools.chain( 257 itertools.chain(
260 neutron.conf.plugins.ml2.drivers.ovs_conf.ovs_opts, 258 neutron.conf.plugins.ml2.drivers.ovs_conf.ovs_opts,
261 neutron.agent.ovsdb.api.OPTS) 259 neutron.conf.agent.ovsdb_api.API_OPTS)
262 ), 260 ),
263 ('agent', 261 ('agent',
264 itertools.chain( 262 itertools.chain(
diff --git a/neutron/services/metering/drivers/iptables/iptables_driver.py b/neutron/services/metering/drivers/iptables/iptables_driver.py
index 7f99c34..e07f584 100644
--- a/neutron/services/metering/drivers/iptables/iptables_driver.py
+++ b/neutron/services/metering/drivers/iptables/iptables_driver.py
@@ -20,7 +20,6 @@ from oslo_utils import importutils
20from neutron._i18n import _ 20from neutron._i18n import _
21from neutron.agent.l3 import dvr_snat_ns 21from neutron.agent.l3 import dvr_snat_ns
22from neutron.agent.l3 import namespaces 22from neutron.agent.l3 import namespaces
23from neutron.agent.linux import interface
24from neutron.agent.linux import ip_lib 23from neutron.agent.linux import ip_lib
25from neutron.agent.linux import iptables_manager 24from neutron.agent.linux import iptables_manager
26from neutron.common import constants 25from neutron.common import constants
@@ -39,7 +38,7 @@ RULE = '-r-'
39LABEL = '-l-' 38LABEL = '-l-'
40 39
41config.register_interface_driver_opts_helper(cfg.CONF) 40config.register_interface_driver_opts_helper(cfg.CONF)
42cfg.CONF.register_opts(interface.OPTS) 41config.register_interface_opts()
43 42
44 43
45class IptablesManagerTransaction(object): 44class IptablesManagerTransaction(object):
diff --git a/neutron/tests/common/net_helpers.py b/neutron/tests/common/net_helpers.py
index eef23c7..9b5e8b0 100644
--- a/neutron/tests/common/net_helpers.py
+++ b/neutron/tests/common/net_helpers.py
@@ -767,7 +767,7 @@ class OVSPortFixture(PortFixture):
767 # machines as the port should be treated by OVS agent and not by 767 # machines as the port should be treated by OVS agent and not by
768 # external party 768 # external party
769 interface_config = cfg.ConfigOpts() 769 interface_config = cfg.ConfigOpts()
770 interface_config.register_opts(interface.OPTS) 770 config.register_interface_opts(interface_config)
771 ovs_interface = interface.OVSInterfaceDriver(interface_config) 771 ovs_interface = interface.OVSInterfaceDriver(interface_config)
772 ovs_interface.plug_new( 772 ovs_interface.plug_new(
773 None, 773 None,
diff --git a/neutron/tests/functional/agent/l2/base.py b/neutron/tests/functional/agent/l2/base.py
index 26efc12..36c954e 100644
--- a/neutron/tests/functional/agent/l2/base.py
+++ b/neutron/tests/functional/agent/l2/base.py
@@ -70,8 +70,8 @@ class OVSAgentTestFramework(base.BaseOVSLinuxTestCase):
70 def _get_config_opts(self): 70 def _get_config_opts(self):
71 config = cfg.ConfigOpts() 71 config = cfg.ConfigOpts()
72 config.register_opts(common_config.core_opts) 72 config.register_opts(common_config.core_opts)
73 config.register_opts(interface.OPTS)
74 ovs_conf.register_ovs_agent_opts(config) 73 ovs_conf.register_ovs_agent_opts(config)
74 agent_config.register_interface_opts(config)
75 agent_config.register_interface_driver_opts_helper(config) 75 agent_config.register_interface_driver_opts_helper(config)
76 agent_config.register_agent_state_opts_helper(config) 76 agent_config.register_agent_state_opts_helper(config)
77 ext_manager.register_opts(config) 77 ext_manager.register_opts(config)
diff --git a/neutron/tests/functional/agent/linux/test_dhcp.py b/neutron/tests/functional/agent/linux/test_dhcp.py
index 94237d8..0fa1fdb 100644
--- a/neutron/tests/functional/agent/linux/test_dhcp.py
+++ b/neutron/tests/functional/agent/linux/test_dhcp.py
@@ -16,7 +16,6 @@ import mock
16from oslo_config import cfg 16from oslo_config import cfg
17 17
18from neutron.agent.linux import dhcp 18from neutron.agent.linux import dhcp
19from neutron.agent.linux import interface
20from neutron.agent.linux import ip_lib 19from neutron.agent.linux import ip_lib
21from neutron.common import utils as common_utils 20from neutron.common import utils as common_utils
22from neutron.conf.agent import common as config 21from neutron.conf.agent import common as config
@@ -31,8 +30,8 @@ class TestDhcp(functional_base.BaseSudoTestCase):
31 def setUp(self): 30 def setUp(self):
32 super(TestDhcp, self).setUp() 31 super(TestDhcp, self).setUp()
33 conf = cfg.ConfigOpts() 32 conf = cfg.ConfigOpts()
34 conf.register_opts(config.INTERFACE_DRIVER_OPTS) 33 config.register_interface_driver_opts_helper(conf)
35 conf.register_opts(interface.OPTS) 34 config.register_interface_opts(conf)
36 conf.register_opts(common_conf.core_opts) 35 conf.register_opts(common_conf.core_opts)
37 conf.register_opts(dhcp_conf.DHCP_AGENT_OPTS) 36 conf.register_opts(dhcp_conf.DHCP_AGENT_OPTS)
38 conf.set_override('interface_driver', 'openvswitch') 37 conf.set_override('interface_driver', 'openvswitch')
diff --git a/neutron/tests/functional/agent/linux/test_interface.py b/neutron/tests/functional/agent/linux/test_interface.py
index c72defd..9a51289 100644
--- a/neutron/tests/functional/agent/linux/test_interface.py
+++ b/neutron/tests/functional/agent/linux/test_interface.py
@@ -23,6 +23,7 @@ from neutron.agent.linux import interface
23from neutron.agent.linux import ip_lib 23from neutron.agent.linux import ip_lib
24from neutron.common import exceptions 24from neutron.common import exceptions
25from neutron.common import utils 25from neutron.common import utils
26from neutron.conf.agent import common as config
26from neutron.tests.common import net_helpers 27from neutron.tests.common import net_helpers
27from neutron.tests.functional.agent.linux import base as linux_base 28from neutron.tests.functional.agent.linux import base as linux_base
28from neutron.tests.functional import base 29from neutron.tests.functional import base
@@ -74,7 +75,7 @@ class OVSInterfaceDriverTestCase(linux_base.BaseOVSLinuxTestCase,
74 def setUp(self): 75 def setUp(self):
75 super(OVSInterfaceDriverTestCase, self).setUp() 76 super(OVSInterfaceDriverTestCase, self).setUp()
76 conf = cfg.ConfigOpts() 77 conf = cfg.ConfigOpts()
77 conf.register_opts(interface.OPTS) 78 config.register_interface_opts(conf)
78 self.interface = interface.OVSInterfaceDriver(conf) 79 self.interface = interface.OVSInterfaceDriver(conf)
79 self.bridge = self.useFixture(net_helpers.OVSBridgeFixture()).bridge 80 self.bridge = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
80 81
@@ -130,7 +131,7 @@ class BridgeInterfaceDriverTestCase(base.BaseSudoTestCase,
130 def setUp(self): 131 def setUp(self):
131 super(BridgeInterfaceDriverTestCase, self).setUp() 132 super(BridgeInterfaceDriverTestCase, self).setUp()
132 conf = cfg.ConfigOpts() 133 conf = cfg.ConfigOpts()
133 conf.register_opts(interface.OPTS) 134 config.register_interface_opts(conf)
134 self.interface = interface.BridgeInterfaceDriver(conf) 135 self.interface = interface.BridgeInterfaceDriver(conf)
135 self.bridge = self.useFixture(net_helpers.LinuxBridgeFixture()).bridge 136 self.bridge = self.useFixture(net_helpers.LinuxBridgeFixture()).bridge
136 137
diff --git a/neutron/tests/functional/agent/linux/test_ip_lib.py b/neutron/tests/functional/agent/linux/test_ip_lib.py
index 7b6c23d..79bc10c 100644
--- a/neutron/tests/functional/agent/linux/test_ip_lib.py
+++ b/neutron/tests/functional/agent/linux/test_ip_lib.py
@@ -23,7 +23,6 @@ from oslo_log import log as logging
23from oslo_utils import importutils 23from oslo_utils import importutils
24import testtools 24import testtools
25 25
26from neutron.agent.linux import interface
27from neutron.agent.linux import ip_lib 26from neutron.agent.linux import ip_lib
28from neutron.common import utils 27from neutron.common import utils
29from neutron.conf.agent import common as config 28from neutron.conf.agent import common as config
@@ -49,7 +48,7 @@ class IpLibTestFramework(functional_base.BaseSudoTestCase):
49 cfg.CONF.set_override( 48 cfg.CONF.set_override(
50 'interface_driver', 49 'interface_driver',
51 'neutron.agent.linux.interface.OVSInterfaceDriver') 50 'neutron.agent.linux.interface.OVSInterfaceDriver')
52 cfg.CONF.register_opts(interface.OPTS) 51 config.register_interface_opts()
53 self.driver = importutils.import_object(cfg.CONF.interface_driver, 52 self.driver = importutils.import_object(cfg.CONF.interface_driver,
54 cfg.CONF) 53 cfg.CONF)
55 54
diff --git a/neutron/tests/unit/agent/common/test_utils.py b/neutron/tests/unit/agent/common/test_utils.py
index 64dc6be..f372e7a 100644
--- a/neutron/tests/unit/agent/common/test_utils.py
+++ b/neutron/tests/unit/agent/common/test_utils.py
@@ -27,7 +27,7 @@ class TestLoadInterfaceDriver(base.BaseTestCase):
27 def setUp(self): 27 def setUp(self):
28 super(TestLoadInterfaceDriver, self).setUp() 28 super(TestLoadInterfaceDriver, self).setUp()
29 self.conf = config.setup_conf() 29 self.conf = config.setup_conf()
30 self.conf.register_opts(interface.OPTS) 30 config.register_interface_opts(self.conf)
31 config.register_interface_driver_opts_helper(self.conf) 31 config.register_interface_driver_opts_helper(self.conf)
32 32
33 def test_load_interface_driver_not_set(self): 33 def test_load_interface_driver_not_set(self):
diff --git a/neutron/tests/unit/agent/dhcp/test_agent.py b/neutron/tests/unit/agent/dhcp/test_agent.py
index 21dfaa4..150f0c6 100644
--- a/neutron/tests/unit/agent/dhcp/test_agent.py
+++ b/neutron/tests/unit/agent/dhcp/test_agent.py
@@ -262,7 +262,7 @@ class TestDhcpAgent(base.BaseTestCase):
262 cfg.CONF.register_opts(dhcp_config.DHCP_AGENT_OPTS) 262 cfg.CONF.register_opts(dhcp_config.DHCP_AGENT_OPTS)
263 config.register_interface_driver_opts_helper(cfg.CONF) 263 config.register_interface_driver_opts_helper(cfg.CONF)
264 config.register_agent_state_opts_helper(cfg.CONF) 264 config.register_agent_state_opts_helper(cfg.CONF)
265 cfg.CONF.register_opts(interface.OPTS) 265 config.register_interface_opts(cfg.CONF)
266 common_config.init(sys.argv[1:]) 266 common_config.init(sys.argv[1:])
267 agent_mgr = dhcp_agent.DhcpAgentWithStateReport( 267 agent_mgr = dhcp_agent.DhcpAgentWithStateReport(
268 'testhost') 268 'testhost')
diff --git a/neutron/tests/unit/agent/l3/test_agent.py b/neutron/tests/unit/agent/l3/test_agent.py
index 03042de..44bc880 100644
--- a/neutron/tests/unit/agent/l3/test_agent.py
+++ b/neutron/tests/unit/agent/l3/test_agent.py
@@ -41,7 +41,6 @@ from neutron.agent.l3 import namespaces
41from neutron.agent.l3 import router_info as l3router 41from neutron.agent.l3 import router_info as l3router
42from neutron.agent.l3 import router_processing_queue 42from neutron.agent.l3 import router_processing_queue
43from neutron.agent.linux import dibbler 43from neutron.agent.linux import dibbler
44from neutron.agent.linux import external_process
45from neutron.agent.linux import interface 44from neutron.agent.linux import interface
46from neutron.agent.linux import iptables_manager 45from neutron.agent.linux import iptables_manager
47from neutron.agent.linux import pd 46from neutron.agent.linux import pd
@@ -77,10 +76,10 @@ class BasicRouterOperationsFramework(base.BaseTestCase):
77 agent_config.register_interface_driver_opts_helper(self.conf) 76 agent_config.register_interface_driver_opts_helper(self.conf)
78 agent_config.register_process_monitor_opts(self.conf) 77 agent_config.register_process_monitor_opts(self.conf)
79 agent_config.register_availability_zone_opts_helper(self.conf) 78 agent_config.register_availability_zone_opts_helper(self.conf)
80 self.conf.register_opts(interface.OPTS) 79 agent_config.register_interface_opts(self.conf)
81 self.conf.register_opts(external_process.OPTS) 80 agent_config.register_external_process_opts(self.conf)
82 self.conf.register_opts(pd.OPTS) 81 agent_config.register_pd_opts(self.conf)
83 self.conf.register_opts(ra.OPTS) 82 agent_config.register_ra_opts(self.conf)
84 self.conf.set_override('interface_driver', 83 self.conf.set_override('interface_driver',
85 'neutron.agent.linux.interface.NullDriver') 84 'neutron.agent.linux.interface.NullDriver')
86 self.conf.set_override('state_path', cfg.CONF.state_path) 85 self.conf.set_override('state_path', cfg.CONF.state_path)
diff --git a/neutron/tests/unit/agent/l3/test_dvr_local_router.py b/neutron/tests/unit/agent/l3/test_dvr_local_router.py
index 02605d5..4cb5680 100644
--- a/neutron/tests/unit/agent/l3/test_dvr_local_router.py
+++ b/neutron/tests/unit/agent/l3/test_dvr_local_router.py
@@ -25,7 +25,6 @@ from neutron.agent.l3 import dvr_edge_router as dvr_edge_rtr
25from neutron.agent.l3 import dvr_local_router as dvr_router 25from neutron.agent.l3 import dvr_local_router as dvr_router
26from neutron.agent.l3 import link_local_allocator as lla 26from neutron.agent.l3 import link_local_allocator as lla
27from neutron.agent.l3 import router_info 27from neutron.agent.l3 import router_info
28from neutron.agent.linux import external_process
29from neutron.agent.linux import interface 28from neutron.agent.linux import interface
30from neutron.agent.linux import ip_lib 29from neutron.agent.linux import ip_lib
31from neutron.common import constants as n_const 30from neutron.common import constants as n_const
@@ -55,8 +54,8 @@ class TestDvrRouterOperations(base.BaseTestCase):
55 ha_conf.register_l3_agent_ha_opts(self.conf) 54 ha_conf.register_l3_agent_ha_opts(self.conf)
56 agent_config.register_interface_driver_opts_helper(self.conf) 55 agent_config.register_interface_driver_opts_helper(self.conf)
57 agent_config.register_process_monitor_opts(self.conf) 56 agent_config.register_process_monitor_opts(self.conf)
58 self.conf.register_opts(interface.OPTS) 57 agent_config.register_interface_opts(self.conf)
59 self.conf.register_opts(external_process.OPTS) 58 agent_config.register_external_process_opts(self.conf)
60 self.conf.set_override('interface_driver', 59 self.conf.set_override('interface_driver',
61 'neutron.agent.linux.interface.NullDriver') 60 'neutron.agent.linux.interface.NullDriver')
62 self.conf.set_override('state_path', cfg.CONF.state_path) 61 self.conf.set_override('state_path', cfg.CONF.state_path)
diff --git a/neutron/tests/unit/agent/linux/test_dhcp.py b/neutron/tests/unit/agent/linux/test_dhcp.py
index c9cb450..72059dc 100644
--- a/neutron/tests/unit/agent/linux/test_dhcp.py
+++ b/neutron/tests/unit/agent/linux/test_dhcp.py
@@ -25,7 +25,6 @@ from oslo_utils import fileutils
25import testtools 25import testtools
26 26
27from neutron.agent.linux import dhcp 27from neutron.agent.linux import dhcp
28from neutron.agent.linux import external_process
29from neutron.common import constants as n_const 28from neutron.common import constants as n_const
30from neutron.conf.agent import common as config 29from neutron.conf.agent import common as config
31from neutron.conf.agent import dhcp as dhcp_config 30from neutron.conf.agent import dhcp as dhcp_config
@@ -940,7 +939,7 @@ class TestConfBase(base.BaseTestCase):
940 self.conf.register_opts(base_config.core_opts) 939 self.conf.register_opts(base_config.core_opts)
941 self.conf.register_opts(dhcp_config.DHCP_OPTS) 940 self.conf.register_opts(dhcp_config.DHCP_OPTS)
942 self.conf.register_opts(dhcp_config.DNSMASQ_OPTS) 941 self.conf.register_opts(dhcp_config.DNSMASQ_OPTS)
943 self.conf.register_opts(external_process.OPTS) 942 config.register_external_process_opts(self.conf)
944 config.register_interface_driver_opts_helper(self.conf) 943 config.register_interface_driver_opts_helper(self.conf)
945 944
946 945
diff --git a/neutron/tests/unit/agent/linux/test_interface.py b/neutron/tests/unit/agent/linux/test_interface.py
index 057151f..2c0598b 100644
--- a/neutron/tests/unit/agent/linux/test_interface.py
+++ b/neutron/tests/unit/agent/linux/test_interface.py
@@ -58,7 +58,7 @@ class TestBase(base.BaseTestCase):
58 def setUp(self): 58 def setUp(self):
59 super(TestBase, self).setUp() 59 super(TestBase, self).setUp()
60 self.conf = config.setup_conf() 60 self.conf = config.setup_conf()
61 self.conf.register_opts(interface.OPTS) 61 config.register_interface_opts(self.conf)
62 self.ip_dev_p = mock.patch.object(ip_lib, 'IPDevice') 62 self.ip_dev_p = mock.patch.object(ip_lib, 'IPDevice')
63 self.ip_dev = self.ip_dev_p.start() 63 self.ip_dev = self.ip_dev_p.start()
64 self.ip_p = mock.patch.object(ip_lib, 'IPWrapper') 64 self.ip_p = mock.patch.object(ip_lib, 'IPWrapper')
diff --git a/neutron/tests/unit/debug/test_commands.py b/neutron/tests/unit/debug/test_commands.py
index fa0260a..ec80674 100644
--- a/neutron/tests/unit/debug/test_commands.py
+++ b/neutron/tests/unit/debug/test_commands.py
@@ -35,7 +35,7 @@ class MyApp(object):
35class TestDebugCommands(base.BaseTestCase): 35class TestDebugCommands(base.BaseTestCase):
36 def setUp(self): 36 def setUp(self):
37 super(TestDebugCommands, self).setUp() 37 super(TestDebugCommands, self).setUp()
38 cfg.CONF.register_opts(interface.OPTS) 38 config.register_interface_opts()
39 cfg.CONF.register_opts(config.EXT_NET_BRIDGE_OPTS) 39 cfg.CONF.register_opts(config.EXT_NET_BRIDGE_OPTS)
40 common_config.init([]) 40 common_config.init([])
41 config.register_interface_driver_opts_helper(cfg.CONF) 41 config.register_interface_driver_opts_helper(cfg.CONF)