summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Perkins <john.d.perkins@gmail.com>2016-07-15 12:44:03 -0600
committerJohn Perkins <john.d.perkins@gmail.com>2017-03-15 09:52:18 -0600
commit7f23ccce23066af3a977c3accb04d3927bb467fb (patch)
tree4fd4a1f9cd3d1df480cfd158b2b568dec0f581b5
parent1414ea9538900cc20471a67f01f3d7cc16a1c664 (diff)
Agent common config
Refactoring Neutron configuration options for agent common config to be in neutron/conf/agent/common. This will allow centralization of all configuration options and provide an easy way to import. Partial-Bug: #1563069 Change-Id: Iebac0cdd3bcfd0135349128921b7ad7a1a939ab8 Needed-By: Ib676003bbe909b5a9013a3178b12dbe291d936af
Notes
Notes (review): Verified+1: Nuage CI <nuage-ci@nuagenetworks.net> Code-Review+1: John Davidge <john.davidge@rackspace.com> Code-Review+2: Armando Migliaccio <armamig@gmail.com> Code-Review+2: Kevin Benton <kevin@benton.pub> Workflow+1: Kevin Benton <kevin@benton.pub> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Wed, 15 Mar 2017 19:25:49 +0000 Reviewed-on: https://review.openstack.org/343045 Project: openstack/neutron Branch: refs/heads/master
-rw-r--r--neutron/agent/common/utils.py2
-rw-r--r--neutron/agent/dhcp_agent.py2
-rw-r--r--neutron/agent/l3_agent.py2
-rw-r--r--neutron/agent/linux/external_process.py3
-rw-r--r--neutron/agent/linux/iptables_manager.py2
-rw-r--r--neutron/agent/linux/utils.py2
-rw-r--r--neutron/agent/metadata_agent.py2
-rw-r--r--neutron/cmd/netns_cleanup.py2
-rw-r--r--neutron/cmd/ovs_cleanup.py2
-rw-r--r--neutron/conf/agent/common.py (renamed from neutron/agent/common/config.py)2
-rw-r--r--neutron/conf/agent/l3/config.py2
-rw-r--r--neutron/debug/shell.py2
-rw-r--r--neutron/opts.py23
-rw-r--r--neutron/plugins/ml2/drivers/agent/config.py2
-rw-r--r--neutron/plugins/ml2/drivers/mech_sriov/agent/common/config.py2
-rw-r--r--neutron/plugins/ml2/drivers/openvswitch/agent/common/config.py2
-rw-r--r--neutron/services/metering/agents/metering_agent.py2
-rw-r--r--neutron/services/metering/drivers/iptables/iptables_driver.py2
-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/l3/framework.py2
-rw-r--r--neutron/tests/functional/agent/linux/test_dhcp.py2
-rw-r--r--neutron/tests/functional/agent/linux/test_ip_lib.py2
-rw-r--r--neutron/tests/functional/agent/test_dhcp_agent.py2
-rw-r--r--neutron/tests/functional/base.py2
-rw-r--r--neutron/tests/unit/agent/common/test_ovs_lib.py2
-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.py2
-rw-r--r--neutron/tests/unit/agent/l3/test_dvr_local_router.py2
-rw-r--r--neutron/tests/unit/agent/l3/test_router_info.py4
-rw-r--r--neutron/tests/unit/agent/linux/test_dhcp.py2
-rw-r--r--neutron/tests/unit/agent/linux/test_interface.py2
-rw-r--r--neutron/tests/unit/agent/linux/test_iptables_firewall.py4
-rw-r--r--neutron/tests/unit/agent/metadata/test_driver.py2
-rw-r--r--neutron/tests/unit/conf/agent/__init__.py0
-rw-r--r--neutron/tests/unit/conf/agent/test_common.py (renamed from neutron/tests/unit/agent/common/test_config.py)2
-rw-r--r--neutron/tests/unit/debug/test_commands.py2
38 files changed, 51 insertions, 49 deletions
diff --git a/neutron/agent/common/utils.py b/neutron/agent/common/utils.py
index 0c35b1f..ebc1363 100644
--- a/neutron/agent/common/utils.py
+++ b/neutron/agent/common/utils.py
@@ -20,8 +20,8 @@ from oslo_log import log as logging
20from oslo_utils import timeutils 20from oslo_utils import timeutils
21 21
22from neutron._i18n import _LE 22from neutron._i18n import _LE
23from neutron.agent.common import config
24from neutron.common import utils as neutron_utils 23from neutron.common import utils as neutron_utils
24from neutron.conf.agent import common as config
25from neutron.conf.agent.database import agents_db 25from neutron.conf.agent.database import agents_db
26 26
27 27
diff --git a/neutron/agent/dhcp_agent.py b/neutron/agent/dhcp_agent.py
index ff34405..6096a13 100644
--- a/neutron/agent/dhcp_agent.py
+++ b/neutron/agent/dhcp_agent.py
@@ -19,10 +19,10 @@ 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.common import config
23from neutron.agent.linux import interface 22from neutron.agent.linux import interface
24from neutron.common import config as common_config 23from neutron.common import config as common_config
25from neutron.common import topics 24from neutron.common import topics
25from neutron.conf.agent import common as config
26from neutron.conf.agent import dhcp as dhcp_config 26from neutron.conf.agent import dhcp as dhcp_config
27from neutron.conf.agent.metadata import config as meta_conf 27from neutron.conf.agent.metadata import config as meta_conf
28from neutron import service as neutron_service 28from neutron import service as neutron_service
diff --git a/neutron/agent/l3_agent.py b/neutron/agent/l3_agent.py
index 810bae5..0c8c052 100644
--- a/neutron/agent/l3_agent.py
+++ b/neutron/agent/l3_agent.py
@@ -19,13 +19,13 @@ 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.common import config
23from neutron.agent.linux import external_process 22from neutron.agent.linux import external_process
24from neutron.agent.linux import interface 23from neutron.agent.linux import interface
25from neutron.agent.linux import pd 24from neutron.agent.linux import pd
26from neutron.agent.linux import ra 25from neutron.agent.linux import ra
27from neutron.common import config as common_config 26from neutron.common import config as common_config
28from neutron.common import topics 27from neutron.common import topics
28from neutron.conf.agent import common as config
29from neutron.conf.agent.l3 import config as l3_config 29from neutron.conf.agent.l3 import config as l3_config
30from neutron.conf.agent.l3 import ha as ha_conf 30from neutron.conf.agent.l3 import ha as ha_conf
31from neutron.conf.agent.metadata import config as meta_conf 31from neutron.conf.agent.metadata import config as meta_conf
diff --git a/neutron/agent/linux/external_process.py b/neutron/agent/linux/external_process.py
index 4e49462..dcb36cd 100644
--- a/neutron/agent/linux/external_process.py
+++ b/neutron/agent/linux/external_process.py
@@ -24,10 +24,11 @@ from oslo_utils import fileutils
24import six 24import six
25 25
26from neutron._i18n import _, _LW, _LE 26from neutron._i18n import _, _LW, _LE
27from neutron.agent.common import config as agent_cfg
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 29
30from neutron.conf.agent import common as agent_cfg
31
31LOG = logging.getLogger(__name__) 32LOG = logging.getLogger(__name__)
32 33
33 34
diff --git a/neutron/agent/linux/iptables_manager.py b/neutron/agent/linux/iptables_manager.py
index a01803e..a741087 100644
--- a/neutron/agent/linux/iptables_manager.py
+++ b/neutron/agent/linux/iptables_manager.py
@@ -32,11 +32,11 @@ from oslo_utils import excutils
32import six 32import six
33 33
34from neutron._i18n import _, _LE, _LW 34from neutron._i18n import _, _LE, _LW
35from neutron.agent.common import config
36from neutron.agent.linux import iptables_comments as ic 35from neutron.agent.linux import iptables_comments as ic
37from neutron.agent.linux import utils as linux_utils 36from neutron.agent.linux import utils as linux_utils
38from neutron.common import exceptions as n_exc 37from neutron.common import exceptions as n_exc
39from neutron.common import utils 38from neutron.common import utils
39from neutron.conf.agent import common as config
40 40
41LOG = logging.getLogger(__name__) 41LOG = logging.getLogger(__name__)
42 42
diff --git a/neutron/agent/linux/utils.py b/neutron/agent/linux/utils.py
index 65b1d99..b6e16a9 100644
--- a/neutron/agent/linux/utils.py
+++ b/neutron/agent/linux/utils.py
@@ -34,9 +34,9 @@ from oslo_utils import fileutils
34from six.moves import http_client as httplib 34from six.moves import http_client as httplib
35 35
36from neutron._i18n import _, _LE 36from neutron._i18n import _, _LE
37from neutron.agent.common import config
38from neutron.agent.linux import xenapi_root_helper 37from neutron.agent.linux import xenapi_root_helper
39from neutron.common import utils 38from neutron.common import utils
39from neutron.conf.agent import common as config
40from neutron import wsgi 40from neutron import wsgi
41 41
42 42
diff --git a/neutron/agent/metadata_agent.py b/neutron/agent/metadata_agent.py
index 7421468..75b2040 100644
--- a/neutron/agent/metadata_agent.py
+++ b/neutron/agent/metadata_agent.py
@@ -17,11 +17,11 @@ import sys
17from oslo_config import cfg 17from oslo_config import cfg
18from oslo_log import log as logging 18from oslo_log import log as logging
19 19
20from neutron.agent.common import config as agent_conf
21from neutron.agent.metadata import agent 20from neutron.agent.metadata import agent
22from neutron.common import cache_utils as cache 21from neutron.common import cache_utils as cache
23from neutron.common import config 22from neutron.common import config
24from neutron.common import utils 23from neutron.common import utils
24from neutron.conf.agent import common as agent_conf
25from neutron.conf.agent.metadata import config as meta 25from neutron.conf.agent.metadata import config as meta
26 26
27LOG = logging.getLogger(__name__) 27LOG = logging.getLogger(__name__)
diff --git a/neutron/cmd/netns_cleanup.py b/neutron/cmd/netns_cleanup.py
index 1dd391c..d6e660d 100644
--- a/neutron/cmd/netns_cleanup.py
+++ b/neutron/cmd/netns_cleanup.py
@@ -24,7 +24,6 @@ from oslo_log import log as logging
24from oslo_utils import importutils 24from oslo_utils import importutils
25 25
26from neutron._i18n import _LE, _LW 26from neutron._i18n import _LE, _LW
27from neutron.agent.common import config as agent_config
28from neutron.agent.common import ovs_lib 27from neutron.agent.common import ovs_lib
29from neutron.agent.l3 import dvr_fip_ns 28from neutron.agent.l3 import dvr_fip_ns
30from neutron.agent.l3 import dvr_snat_ns 29from neutron.agent.l3 import dvr_snat_ns
@@ -36,6 +35,7 @@ from neutron.agent.linux import ip_lib
36from neutron.agent.linux import utils 35from neutron.agent.linux import utils
37from neutron.common import config 36from neutron.common import config
38from neutron.conf.agent import cmd 37from neutron.conf.agent import cmd
38from neutron.conf.agent import common as agent_config
39from neutron.conf.agent import dhcp as dhcp_config 39from neutron.conf.agent import dhcp as dhcp_config
40 40
41 41
diff --git a/neutron/cmd/ovs_cleanup.py b/neutron/cmd/ovs_cleanup.py
index feec533..34c1887 100644
--- a/neutron/cmd/ovs_cleanup.py
+++ b/neutron/cmd/ovs_cleanup.py
@@ -17,12 +17,12 @@ from oslo_config import cfg
17from oslo_log import log as logging 17from oslo_log import log as logging
18 18
19from neutron._i18n import _LI 19from neutron._i18n import _LI
20from neutron.agent.common import config as agent_config
21from neutron.agent.common import ovs_lib 20from neutron.agent.common import ovs_lib
22from neutron.agent.linux import interface 21from neutron.agent.linux import interface
23from neutron.agent.linux import ip_lib 22from neutron.agent.linux import ip_lib
24from neutron.common import config 23from neutron.common import config
25from neutron.conf.agent import cmd 24from neutron.conf.agent import cmd
25from neutron.conf.agent import common as agent_config
26from neutron.conf.agent.l3 import config as l3_config 26from neutron.conf.agent.l3 import config as l3_config
27 27
28 28
diff --git a/neutron/agent/common/config.py b/neutron/conf/agent/common.py
index 9bffe7a..33dedcc 100644
--- a/neutron/agent/common/config.py
+++ b/neutron/conf/agent/common.py
@@ -131,7 +131,7 @@ def get_log_args(conf, log_file_name, **kwargs):
131 return cmd_args 131 return cmd_args
132 132
133 133
134def register_root_helper(conf): 134def register_root_helper(conf=cfg.CONF):
135 conf.register_opts(ROOT_HELPER_OPTS, 'AGENT') 135 conf.register_opts(ROOT_HELPER_OPTS, 'AGENT')
136 136
137 137
diff --git a/neutron/conf/agent/l3/config.py b/neutron/conf/agent/l3/config.py
index 1331fcd..3b93f86 100644
--- a/neutron/conf/agent/l3/config.py
+++ b/neutron/conf/agent/l3/config.py
@@ -18,7 +18,7 @@ from neutron_lib import constants
18from oslo_config import cfg 18from oslo_config import cfg
19 19
20from neutron._i18n import _ 20from neutron._i18n import _
21from neutron.agent.common import config 21from neutron.conf.agent import common as config
22 22
23 23
24OPTS = [ 24OPTS = [
diff --git a/neutron/debug/shell.py b/neutron/debug/shell.py
index dd4d1c4..d60534c 100644
--- a/neutron/debug/shell.py
+++ b/neutron/debug/shell.py
@@ -20,9 +20,9 @@ from oslo_utils import importutils
20 20
21from neutron._i18n import _ 21from neutron._i18n import _
22from neutron._i18n import _LW 22from neutron._i18n import _LW
23from neutron.agent.common import config
24from neutron.agent.common import utils 23from neutron.agent.common import utils
25from neutron.agent.linux import interface 24from neutron.agent.linux import interface
25from neutron.conf.agent import common as config
26from neutron.debug import debug_agent 26from neutron.debug import debug_agent
27from neutronclient.common import exceptions as exc 27from neutronclient.common import exceptions as exc
28from neutronclient import shell 28from neutronclient import shell
diff --git a/neutron/opts.py b/neutron/opts.py
index 3cd9caf..395c020 100644
--- a/neutron/opts.py
+++ b/neutron/opts.py
@@ -17,7 +17,7 @@ import operator
17from keystoneauth1 import loading as ks_loading 17from keystoneauth1 import loading as ks_loading
18from oslo_config import cfg 18from oslo_config import cfg
19 19
20import neutron.agent.common.config 20import neutron.agent.agent_extensions_manager
21import neutron.agent.linux.interface 21import neutron.agent.linux.interface
22import neutron.agent.linux.pd 22import neutron.agent.linux.pd
23import neutron.agent.linux.ra 23import neutron.agent.linux.ra
@@ -25,6 +25,7 @@ import neutron.agent.ovsdb.api
25import neutron.agent.securitygroups_rpc 25import neutron.agent.securitygroups_rpc
26import neutron.common.cache_utils 26import neutron.common.cache_utils
27import neutron.conf.agent.agent_extensions_manager 27import neutron.conf.agent.agent_extensions_manager
28import neutron.conf.agent.common
28import neutron.conf.agent.dhcp 29import neutron.conf.agent.dhcp
29import neutron.conf.agent.l3.config 30import neutron.conf.agent.l3.config
30import neutron.conf.agent.l3.ha 31import neutron.conf.agent.l3.ha
@@ -80,15 +81,15 @@ def list_agent_opts():
80 return [ 81 return [
81 ('agent', 82 ('agent',
82 itertools.chain( 83 itertools.chain(
83 neutron.agent.common.config.ROOT_HELPER_OPTS, 84 neutron.conf.agent.common.ROOT_HELPER_OPTS,
84 neutron.agent.common.config.AGENT_STATE_OPTS, 85 neutron.conf.agent.common.AGENT_STATE_OPTS,
85 neutron.agent.common.config.IPTABLES_OPTS, 86 neutron.conf.agent.common.IPTABLES_OPTS,
86 neutron.agent.common.config.PROCESS_MONITOR_OPTS, 87 neutron.conf.agent.common.PROCESS_MONITOR_OPTS,
87 neutron.agent.common.config.AVAILABILITY_ZONE_OPTS) 88 neutron.conf.agent.common.AVAILABILITY_ZONE_OPTS)
88 ), 89 ),
89 ('DEFAULT', 90 ('DEFAULT',
90 itertools.chain( 91 itertools.chain(
91 neutron.agent.common.config.INTERFACE_DRIVER_OPTS, 92 neutron.conf.agent.common.INTERFACE_DRIVER_OPTS,
92 neutron.conf.agent.metadata.config.SHARED_OPTS) 93 neutron.conf.agent.metadata.config.SHARED_OPTS)
93 ) 94 )
94 ] 95 ]
@@ -154,17 +155,17 @@ def list_base_agent_opts():
154 ('DEFAULT', 155 ('DEFAULT',
155 itertools.chain( 156 itertools.chain(
156 neutron.agent.linux.interface.OPTS, 157 neutron.agent.linux.interface.OPTS,
157 neutron.agent.common.config.INTERFACE_DRIVER_OPTS, 158 neutron.conf.agent.common.INTERFACE_DRIVER_OPTS,
158 neutron.conf.agent.ovs_conf.OPTS) 159 neutron.conf.agent.ovs_conf.OPTS)
159 ), 160 ),
160 ('agent', neutron.agent.common.config.AGENT_STATE_OPTS), 161 ('agent', neutron.conf.agent.common.AGENT_STATE_OPTS),
161 ('ovs', neutron.agent.ovsdb.api.OPTS), 162 ('ovs', neutron.agent.ovsdb.api.OPTS),
162 ] 163 ]
163 164
164 165
165def list_az_agent_opts(): 166def list_az_agent_opts():
166 return [ 167 return [
167 ('agent', neutron.agent.common.config.AVAILABILITY_ZONE_OPTS), 168 ('agent', neutron.conf.agent.common.AVAILABILITY_ZONE_OPTS),
168 ] 169 ]
169 170
170 171
@@ -231,7 +232,7 @@ def list_metadata_agent_opts():
231 meta_conf.UNIX_DOMAIN_METADATA_PROXY_OPTS, 232 meta_conf.UNIX_DOMAIN_METADATA_PROXY_OPTS,
232 neutron.conf.cache_utils.cache_opts) 233 neutron.conf.cache_utils.cache_opts)
233 ), 234 ),
234 ('agent', neutron.agent.common.config.AGENT_STATE_OPTS) 235 ('agent', neutron.conf.agent.common.AGENT_STATE_OPTS)
235 ] 236 ]
236 237
237 238
diff --git a/neutron/plugins/ml2/drivers/agent/config.py b/neutron/plugins/ml2/drivers/agent/config.py
index efbdfc7..7dc728e 100644
--- a/neutron/plugins/ml2/drivers/agent/config.py
+++ b/neutron/plugins/ml2/drivers/agent/config.py
@@ -16,7 +16,7 @@
16 16
17from oslo_config import cfg 17from oslo_config import cfg
18 18
19from neutron.agent.common import config 19from neutron.conf.agent import common as config
20from neutron.conf.plugins.ml2.drivers import agent 20from neutron.conf.plugins.ml2.drivers import agent
21 21
22agent.register_agent_opts() 22agent.register_agent_opts()
diff --git a/neutron/plugins/ml2/drivers/mech_sriov/agent/common/config.py b/neutron/plugins/ml2/drivers/mech_sriov/agent/common/config.py
index 10b3d17..2f967e3 100644
--- a/neutron/plugins/ml2/drivers/mech_sriov/agent/common/config.py
+++ b/neutron/plugins/ml2/drivers/mech_sriov/agent/common/config.py
@@ -17,7 +17,7 @@
17from oslo_config import cfg 17from oslo_config import cfg
18 18
19from neutron._i18n import _ 19from neutron._i18n import _
20from neutron.agent.common import config 20from neutron.conf.agent import common as config
21from neutron.conf.plugins.ml2.drivers.mech_sriov import agent_common as \ 21from neutron.conf.plugins.ml2.drivers.mech_sriov import agent_common as \
22 agent_common_config 22 agent_common_config
23 23
diff --git a/neutron/plugins/ml2/drivers/openvswitch/agent/common/config.py b/neutron/plugins/ml2/drivers/openvswitch/agent/common/config.py
index 366c97f..3ea4f0c 100644
--- a/neutron/plugins/ml2/drivers/openvswitch/agent/common/config.py
+++ b/neutron/plugins/ml2/drivers/openvswitch/agent/common/config.py
@@ -14,7 +14,7 @@
14 14
15from oslo_config import cfg 15from oslo_config import cfg
16 16
17from neutron.agent.common import config 17from neutron.conf.agent import common as config
18from neutron.conf.plugins.ml2.drivers import ovs_conf 18from neutron.conf.plugins.ml2.drivers import ovs_conf
19 19
20ovs_conf.register_ovs_agent_opts() 20ovs_conf.register_ovs_agent_opts()
diff --git a/neutron/services/metering/agents/metering_agent.py b/neutron/services/metering/agents/metering_agent.py
index 14a7a1d..a4fcb87 100644
--- a/neutron/services/metering/agents/metering_agent.py
+++ b/neutron/services/metering/agents/metering_agent.py
@@ -26,13 +26,13 @@ from oslo_utils import importutils
26from oslo_utils import timeutils 26from oslo_utils import timeutils
27 27
28from neutron._i18n import _, _LE, _LI, _LW 28from neutron._i18n import _, _LE, _LI, _LW
29from neutron.agent.common import config
30from neutron.agent import rpc as agent_rpc 29from neutron.agent import rpc as agent_rpc
31from neutron.common import config as common_config 30from neutron.common import config as common_config
32from neutron.common import constants as n_const 31from neutron.common import constants as n_const
33from neutron.common import rpc as n_rpc 32from neutron.common import rpc as n_rpc
34from neutron.common import topics 33from neutron.common import topics
35from neutron.common import utils 34from neutron.common import utils
35from neutron.conf.agent import common as config
36from neutron.conf.services import metering_agent 36from neutron.conf.services import metering_agent
37from neutron import manager 37from neutron import manager
38from neutron import service as neutron_service 38from neutron import service as neutron_service
diff --git a/neutron/services/metering/drivers/iptables/iptables_driver.py b/neutron/services/metering/drivers/iptables/iptables_driver.py
index 860fc73..3c4971b 100644
--- a/neutron/services/metering/drivers/iptables/iptables_driver.py
+++ b/neutron/services/metering/drivers/iptables/iptables_driver.py
@@ -19,7 +19,6 @@ from oslo_utils import importutils
19import six 19import six
20 20
21from neutron._i18n import _, _LE, _LI 21from neutron._i18n import _, _LE, _LI
22from neutron.agent.common import config
23from neutron.agent.l3 import dvr_snat_ns 22from neutron.agent.l3 import dvr_snat_ns
24from neutron.agent.l3 import namespaces 23from neutron.agent.l3 import namespaces
25from neutron.agent.linux import interface 24from neutron.agent.linux import interface
@@ -27,6 +26,7 @@ from neutron.agent.linux import ip_lib
27from neutron.agent.linux import iptables_manager 26from neutron.agent.linux import iptables_manager
28from neutron.common import constants 27from neutron.common import constants
29from neutron.common import ipv6_utils 28from neutron.common import ipv6_utils
29from neutron.conf.agent import common as config
30from neutron.services.metering.drivers import abstract_driver 30from neutron.services.metering.drivers import abstract_driver
31 31
32 32
diff --git a/neutron/tests/common/net_helpers.py b/neutron/tests/common/net_helpers.py
index 8b63b31..7382941 100644
--- a/neutron/tests/common/net_helpers.py
+++ b/neutron/tests/common/net_helpers.py
@@ -33,7 +33,6 @@ from oslo_config import cfg
33from oslo_utils import uuidutils 33from oslo_utils import uuidutils
34import six 34import six
35 35
36from neutron.agent.common import config
37from neutron.agent.common import ovs_lib 36from neutron.agent.common import ovs_lib
38from neutron.agent.linux import bridge_lib 37from neutron.agent.linux import bridge_lib
39from neutron.agent.linux import interface 38from neutron.agent.linux import interface
@@ -41,6 +40,7 @@ from neutron.agent.linux import ip_lib
41from neutron.agent.linux import iptables_firewall 40from neutron.agent.linux import iptables_firewall
42from neutron.agent.linux import utils 41from neutron.agent.linux import utils
43from neutron.common import utils as common_utils 42from neutron.common import utils as common_utils
43from neutron.conf.agent import common as config
44from neutron.db import db_base_plugin_common 44from neutron.db import db_base_plugin_common
45from neutron.plugins.ml2.drivers.linuxbridge.agent import \ 45from neutron.plugins.ml2.drivers.linuxbridge.agent import \
46 linuxbridge_neutron_agent as linuxbridge_agent 46 linuxbridge_neutron_agent as linuxbridge_agent
diff --git a/neutron/tests/functional/agent/l2/base.py b/neutron/tests/functional/agent/l2/base.py
index cf4aac6..e737331 100644
--- a/neutron/tests/functional/agent/l2/base.py
+++ b/neutron/tests/functional/agent/l2/base.py
@@ -23,12 +23,12 @@ from neutron_lib.utils import net
23from oslo_config import cfg 23from oslo_config import cfg
24from oslo_utils import uuidutils 24from oslo_utils import uuidutils
25 25
26from neutron.agent.common import config as agent_config
27from neutron.agent.common import ovs_lib 26from neutron.agent.common import ovs_lib
28from neutron.agent.l2 import l2_agent_extensions_manager as ext_manager 27from neutron.agent.l2 import l2_agent_extensions_manager as ext_manager
29from neutron.agent.linux import interface 28from neutron.agent.linux import interface
30from neutron.agent.linux import polling 29from neutron.agent.linux import polling
31from neutron.common import utils 30from neutron.common import utils
31from neutron.conf.agent import common as agent_config
32from neutron.conf import common as common_config 32from neutron.conf import common as common_config
33from neutron.conf.plugins.ml2.drivers import ovs_conf 33from neutron.conf.plugins.ml2.drivers import ovs_conf
34from neutron.plugins.common import constants as p_const 34from neutron.plugins.common import constants as p_const
diff --git a/neutron/tests/functional/agent/l3/framework.py b/neutron/tests/functional/agent/l3/framework.py
index 27e8b8a..0c41e3c 100644
--- a/neutron/tests/functional/agent/l3/framework.py
+++ b/neutron/tests/functional/agent/l3/framework.py
@@ -25,7 +25,6 @@ from oslo_utils import uuidutils
25import testtools 25import testtools
26import textwrap 26import textwrap
27 27
28from neutron.agent.common import config as agent_config
29from neutron.agent.common import ovs_lib 28from neutron.agent.common import ovs_lib
30from neutron.agent.l3 import agent as neutron_l3_agent 29from neutron.agent.l3 import agent as neutron_l3_agent
31from neutron.agent.l3 import namespaces 30from neutron.agent.l3 import namespaces
@@ -35,6 +34,7 @@ from neutron.agent.linux import external_process
35from neutron.agent.linux import ip_lib 34from neutron.agent.linux import ip_lib
36from neutron.agent.linux import keepalived 35from neutron.agent.linux import keepalived
37from neutron.common import utils as common_utils 36from neutron.common import utils as common_utils
37from neutron.conf.agent import common as agent_config
38from neutron.conf import common as common_config 38from neutron.conf import common as common_config
39from neutron.tests.common import l3_test_common 39from neutron.tests.common import l3_test_common
40from neutron.tests.common import net_helpers 40from neutron.tests.common import net_helpers
diff --git a/neutron/tests/functional/agent/linux/test_dhcp.py b/neutron/tests/functional/agent/linux/test_dhcp.py
index 459e387..009f335 100644
--- a/neutron/tests/functional/agent/linux/test_dhcp.py
+++ b/neutron/tests/functional/agent/linux/test_dhcp.py
@@ -15,11 +15,11 @@
15import mock 15import mock
16from oslo_config import cfg 16from oslo_config import cfg
17 17
18from neutron.agent.common import config
19from neutron.agent.linux import dhcp 18from neutron.agent.linux import dhcp
20from neutron.agent.linux import interface 19from neutron.agent.linux import interface
21from neutron.agent.linux import ip_lib 20from neutron.agent.linux import ip_lib
22from neutron.common import utils as common_utils 21from neutron.common import utils as common_utils
22from neutron.conf.agent import common as config
23from neutron.conf.agent import dhcp as dhcp_conf 23from neutron.conf.agent import dhcp as dhcp_conf
24from neutron.conf import common as common_conf 24from neutron.conf import common as common_conf
25from neutron.tests import base as tests_base 25from neutron.tests import base as tests_base
diff --git a/neutron/tests/functional/agent/linux/test_ip_lib.py b/neutron/tests/functional/agent/linux/test_ip_lib.py
index 12222c5..7b6c23d 100644
--- a/neutron/tests/functional/agent/linux/test_ip_lib.py
+++ b/neutron/tests/functional/agent/linux/test_ip_lib.py
@@ -23,10 +23,10 @@ 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.common import config
27from neutron.agent.linux import interface 26from neutron.agent.linux import interface
28from neutron.agent.linux import ip_lib 27from neutron.agent.linux import ip_lib
29from neutron.common import utils 28from neutron.common import utils
29from neutron.conf.agent import common as config
30from neutron.tests.common import net_helpers 30from neutron.tests.common import net_helpers
31from neutron.tests.functional import base as functional_base 31from neutron.tests.functional import base as functional_base
32 32
diff --git a/neutron/tests/functional/agent/test_dhcp_agent.py b/neutron/tests/functional/agent/test_dhcp_agent.py
index 8678020..f30bb9d 100644
--- a/neutron/tests/functional/agent/test_dhcp_agent.py
+++ b/neutron/tests/functional/agent/test_dhcp_agent.py
@@ -24,7 +24,6 @@ from neutron_lib import constants as lib_const
24from oslo_config import fixture as fixture_config 24from oslo_config import fixture as fixture_config
25from oslo_utils import uuidutils 25from oslo_utils import uuidutils
26 26
27from neutron.agent.common import config
28from neutron.agent.common import ovs_lib 27from neutron.agent.common import ovs_lib
29from neutron.agent.dhcp import agent 28from neutron.agent.dhcp import agent
30from neutron.agent import dhcp_agent 29from neutron.agent import dhcp_agent
@@ -34,6 +33,7 @@ from neutron.agent.linux import interface
34from neutron.agent.linux import ip_lib 33from neutron.agent.linux import ip_lib
35from neutron.agent.linux import utils 34from neutron.agent.linux import utils
36from neutron.common import utils as common_utils 35from neutron.common import utils as common_utils
36from neutron.conf.agent import common as config
37from neutron.tests.common import net_helpers 37from neutron.tests.common import net_helpers
38from neutron.tests.functional.agent.linux import helpers 38from neutron.tests.functional.agent.linux import helpers
39from neutron.tests.functional import base 39from neutron.tests.functional import base
diff --git a/neutron/tests/functional/base.py b/neutron/tests/functional/base.py
index 2d3e0df..08d5f58 100644
--- a/neutron/tests/functional/base.py
+++ b/neutron/tests/functional/base.py
@@ -17,8 +17,8 @@ import os
17 17
18from oslo_config import cfg 18from oslo_config import cfg
19 19
20from neutron.agent.common import config
21from neutron.agent.linux import utils 20from neutron.agent.linux import utils
21from neutron.conf.agent import common as config
22from neutron.tests import base 22from neutron.tests import base
23from neutron.tests.common import base as common_base 23from neutron.tests.common import base as common_base
24from neutron.tests.common import helpers 24from neutron.tests.common import helpers
diff --git a/neutron/tests/unit/agent/common/test_ovs_lib.py b/neutron/tests/unit/agent/common/test_ovs_lib.py
index 48eab0f..fa44ac4 100644
--- a/neutron/tests/unit/agent/common/test_ovs_lib.py
+++ b/neutron/tests/unit/agent/common/test_ovs_lib.py
@@ -21,9 +21,9 @@ from oslo_utils import uuidutils
21import tenacity 21import tenacity
22import testtools 22import testtools
23 23
24from neutron.agent.common import config
25from neutron.agent.common import ovs_lib 24from neutron.agent.common import ovs_lib
26from neutron.agent.common import utils 25from neutron.agent.common import utils
26from neutron.conf.agent import common as config
27from neutron.plugins.common import constants 27from neutron.plugins.common import constants
28from neutron.plugins.ml2.drivers.openvswitch.agent.common \ 28from neutron.plugins.ml2.drivers.openvswitch.agent.common \
29 import constants as p_const 29 import constants as p_const
diff --git a/neutron/tests/unit/agent/common/test_utils.py b/neutron/tests/unit/agent/common/test_utils.py
index 12eda7a..64dc6be 100644
--- a/neutron/tests/unit/agent/common/test_utils.py
+++ b/neutron/tests/unit/agent/common/test_utils.py
@@ -15,9 +15,9 @@
15 15
16import mock 16import mock
17 17
18from neutron.agent.common import config
19from neutron.agent.common import utils 18from neutron.agent.common import utils
20from neutron.agent.linux import interface 19from neutron.agent.linux import interface
20from neutron.conf.agent import common as config
21from neutron.tests import base 21from neutron.tests import base
22from neutron.tests.unit import testlib_api 22from neutron.tests.unit import testlib_api
23 23
diff --git a/neutron/tests/unit/agent/dhcp/test_agent.py b/neutron/tests/unit/agent/dhcp/test_agent.py
index 00cf751..02c3248 100644
--- a/neutron/tests/unit/agent/dhcp/test_agent.py
+++ b/neutron/tests/unit/agent/dhcp/test_agent.py
@@ -26,7 +26,6 @@ from oslo_config import cfg
26import oslo_messaging 26import oslo_messaging
27import testtools 27import testtools
28 28
29from neutron.agent.common import config
30from neutron.agent.dhcp import agent as dhcp_agent 29from neutron.agent.dhcp import agent as dhcp_agent
31from neutron.agent import dhcp_agent as entry 30from neutron.agent import dhcp_agent as entry
32from neutron.agent.linux import dhcp 31from neutron.agent.linux import dhcp
@@ -35,6 +34,7 @@ from neutron.agent.metadata import driver as metadata_driver
35from neutron.common import config as common_config 34from neutron.common import config as common_config
36from neutron.common import constants as n_const 35from neutron.common import constants as n_const
37from neutron.common import utils 36from neutron.common import utils
37from neutron.conf.agent import common as config
38from neutron.conf.agent import dhcp as dhcp_config 38from neutron.conf.agent import dhcp as dhcp_config
39from neutron.tests import base 39from neutron.tests import base
40 40
diff --git a/neutron/tests/unit/agent/l3/test_agent.py b/neutron/tests/unit/agent/l3/test_agent.py
index eecb42a..ba2f11e 100644
--- a/neutron/tests/unit/agent/l3/test_agent.py
+++ b/neutron/tests/unit/agent/l3/test_agent.py
@@ -30,7 +30,6 @@ from oslo_utils import uuidutils
30import six 30import six
31from testtools import matchers 31from testtools import matchers
32 32
33from neutron.agent.common import config as agent_config
34from neutron.agent.l3 import agent as l3_agent 33from neutron.agent.l3 import agent as l3_agent
35from neutron.agent.l3 import dvr_edge_router as dvr_router 34from neutron.agent.l3 import dvr_edge_router as dvr_router
36from neutron.agent.l3 import dvr_snat_ns 35from neutron.agent.l3 import dvr_snat_ns
@@ -49,6 +48,7 @@ from neutron.agent.metadata import driver as metadata_driver
49from neutron.agent import rpc as agent_rpc 48from neutron.agent import rpc as agent_rpc
50from neutron.common import constants as n_const 49from neutron.common import constants as n_const
51from neutron.common import exceptions as n_exc 50from neutron.common import exceptions as n_exc
51from neutron.conf.agent import common as agent_config
52from neutron.conf.agent.l3 import config as l3_config 52from neutron.conf.agent.l3 import config as l3_config
53from neutron.conf.agent.l3 import ha as ha_conf 53from neutron.conf.agent.l3 import ha as ha_conf
54from neutron.conf import common as base_config 54from neutron.conf import common as base_config
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 0069f09..6e6291a 100644
--- a/neutron/tests/unit/agent/l3/test_dvr_local_router.py
+++ b/neutron/tests/unit/agent/l3/test_dvr_local_router.py
@@ -19,7 +19,6 @@ from oslo_config import cfg
19from oslo_log import log 19from oslo_log import log
20from oslo_utils import uuidutils 20from oslo_utils import uuidutils
21 21
22from neutron.agent.common import config as agent_config
23from neutron.agent.l3 import agent as l3_agent 22from neutron.agent.l3 import agent as l3_agent
24from neutron.agent.l3 import dvr_local_router as dvr_router 23from neutron.agent.l3 import dvr_local_router as dvr_router
25from neutron.agent.l3 import link_local_allocator as lla 24from neutron.agent.l3 import link_local_allocator as lla
@@ -29,6 +28,7 @@ from neutron.agent.linux import interface
29from neutron.agent.linux import ip_lib 28from neutron.agent.linux import ip_lib
30from neutron.common import constants as n_const 29from neutron.common import constants as n_const
31from neutron.common import utils as common_utils 30from neutron.common import utils as common_utils
31from neutron.conf.agent import common as agent_config
32from neutron.conf.agent.l3 import config as l3_config 32from neutron.conf.agent.l3 import config as l3_config
33from neutron.conf.agent.l3 import ha as ha_conf 33from neutron.conf.agent.l3 import ha as ha_conf
34from neutron.conf import common as base_config 34from neutron.conf import common as base_config
diff --git a/neutron/tests/unit/agent/l3/test_router_info.py b/neutron/tests/unit/agent/l3/test_router_info.py
index 5706dc9..f13773f 100644
--- a/neutron/tests/unit/agent/l3/test_router_info.py
+++ b/neutron/tests/unit/agent/l3/test_router_info.py
@@ -14,10 +14,10 @@ import mock
14from neutron_lib import constants as lib_constants 14from neutron_lib import constants as lib_constants
15from oslo_utils import uuidutils 15from oslo_utils import uuidutils
16 16
17from neutron.agent.common import config as agent_config
18from neutron.agent.l3 import router_info 17from neutron.agent.l3 import router_info
19from neutron.agent.linux import ip_lib 18from neutron.agent.linux import ip_lib
20from neutron.common import exceptions as n_exc 19from neutron.common import exceptions as n_exc
20from neutron.conf.agent import common as config
21from neutron.tests import base 21from neutron.tests import base
22 22
23 23
@@ -28,7 +28,7 @@ class TestRouterInfo(base.BaseTestCase):
28 def setUp(self): 28 def setUp(self):
29 super(TestRouterInfo, self).setUp() 29 super(TestRouterInfo, self).setUp()
30 30
31 conf = agent_config.setup_conf() 31 conf = config.setup_conf()
32 32
33 self.ip_cls_p = mock.patch('neutron.agent.linux.ip_lib.IPWrapper') 33 self.ip_cls_p = mock.patch('neutron.agent.linux.ip_lib.IPWrapper')
34 ip_cls = self.ip_cls_p.start() 34 ip_cls = self.ip_cls_p.start()
diff --git a/neutron/tests/unit/agent/linux/test_dhcp.py b/neutron/tests/unit/agent/linux/test_dhcp.py
index e2f1c7a..407386e 100644
--- a/neutron/tests/unit/agent/linux/test_dhcp.py
+++ b/neutron/tests/unit/agent/linux/test_dhcp.py
@@ -23,10 +23,10 @@ import oslo_messaging
23from oslo_utils import fileutils 23from oslo_utils import fileutils
24import testtools 24import testtools
25 25
26from neutron.agent.common import config
27from neutron.agent.linux import dhcp 26from neutron.agent.linux import dhcp
28from neutron.agent.linux import external_process 27from neutron.agent.linux import external_process
29from neutron.common import constants as n_const 28from neutron.common import constants as n_const
29from neutron.conf.agent import common as config
30from neutron.conf.agent import dhcp as dhcp_config 30from neutron.conf.agent import dhcp as dhcp_config
31from neutron.conf import common as base_config 31from neutron.conf import common as base_config
32from neutron.extensions import extra_dhcp_opt as edo_ext 32from neutron.extensions import extra_dhcp_opt as edo_ext
diff --git a/neutron/tests/unit/agent/linux/test_interface.py b/neutron/tests/unit/agent/linux/test_interface.py
index 69d6d4c..3c9d3c1 100644
--- a/neutron/tests/unit/agent/linux/test_interface.py
+++ b/neutron/tests/unit/agent/linux/test_interface.py
@@ -16,11 +16,11 @@
16import mock 16import mock
17from neutron_lib import constants 17from neutron_lib import constants
18 18
19from neutron.agent.common import config
20from neutron.agent.common import ovs_lib 19from neutron.agent.common import ovs_lib
21from neutron.agent.linux import interface 20from neutron.agent.linux import interface
22from neutron.agent.linux import ip_lib 21from neutron.agent.linux import ip_lib
23from neutron.agent.linux import utils 22from neutron.agent.linux import utils
23from neutron.conf.agent import common as config
24from neutron.tests import base 24from neutron.tests import base
25 25
26 26
diff --git a/neutron/tests/unit/agent/linux/test_iptables_firewall.py b/neutron/tests/unit/agent/linux/test_iptables_firewall.py
index f7a3a88..06f28e5 100644
--- a/neutron/tests/unit/agent/linux/test_iptables_firewall.py
+++ b/neutron/tests/unit/agent/linux/test_iptables_firewall.py
@@ -21,7 +21,6 @@ from oslo_config import cfg
21import six 21import six
22import testtools 22import testtools
23 23
24from neutron.agent.common import config as a_cfg
25from neutron.agent import firewall 24from neutron.agent import firewall
26from neutron.agent.linux import ip_conntrack 25from neutron.agent.linux import ip_conntrack
27from neutron.agent.linux import ipset_manager 26from neutron.agent.linux import ipset_manager
@@ -29,6 +28,7 @@ from neutron.agent.linux import iptables_comments as ic
29from neutron.agent.linux import iptables_firewall 28from neutron.agent.linux import iptables_firewall
30from neutron.common import exceptions as n_exc 29from neutron.common import exceptions as n_exc
31from neutron.common import utils 30from neutron.common import utils
31from neutron.conf.agent import common as agent_config
32from neutron.conf.agent import securitygroups_rpc as security_config 32from neutron.conf.agent import securitygroups_rpc as security_config
33from neutron.tests import base 33from neutron.tests import base
34from neutron.tests.unit.api.v2 import test_base 34from neutron.tests.unit.api.v2 import test_base
@@ -71,8 +71,8 @@ COMMIT
71class BaseIptablesFirewallTestCase(base.BaseTestCase): 71class BaseIptablesFirewallTestCase(base.BaseTestCase):
72 def setUp(self): 72 def setUp(self):
73 super(BaseIptablesFirewallTestCase, self).setUp() 73 super(BaseIptablesFirewallTestCase, self).setUp()
74 cfg.CONF.register_opts(a_cfg.ROOT_HELPER_OPTS, 'AGENT')
75 security_config.register_securitygroups_opts() 74 security_config.register_securitygroups_opts()
75 agent_config.register_root_helper(cfg.CONF)
76 cfg.CONF.set_override('comment_iptables_rules', False, 'AGENT') 76 cfg.CONF.set_override('comment_iptables_rules', False, 'AGENT')
77 self.utils_exec_p = mock.patch( 77 self.utils_exec_p = mock.patch(
78 'neutron.agent.linux.utils.execute') 78 'neutron.agent.linux.utils.execute')
diff --git a/neutron/tests/unit/agent/metadata/test_driver.py b/neutron/tests/unit/agent/metadata/test_driver.py
index 05e587d..df2dacc 100644
--- a/neutron/tests/unit/agent/metadata/test_driver.py
+++ b/neutron/tests/unit/agent/metadata/test_driver.py
@@ -19,11 +19,11 @@ import mock
19from oslo_config import cfg 19from oslo_config import cfg
20from oslo_utils import uuidutils 20from oslo_utils import uuidutils
21 21
22from neutron.agent.common import config as agent_config
23from neutron.agent.l3 import agent as l3_agent 22from neutron.agent.l3 import agent as l3_agent
24from neutron.agent.l3 import router_info 23from neutron.agent.l3 import router_info
25from neutron.agent.metadata import driver as metadata_driver 24from neutron.agent.metadata import driver as metadata_driver
26from neutron.common import constants 25from neutron.common import constants
26from neutron.conf.agent import common as agent_config
27from neutron.conf.agent.l3 import config as l3_config 27from neutron.conf.agent.l3 import config as l3_config
28from neutron.conf.agent.l3 import ha as ha_conf 28from neutron.conf.agent.l3 import ha as ha_conf
29from neutron.conf.agent.metadata import config as meta_conf 29from neutron.conf.agent.metadata import config as meta_conf
diff --git a/neutron/tests/unit/conf/agent/__init__.py b/neutron/tests/unit/conf/agent/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/neutron/tests/unit/conf/agent/__init__.py
diff --git a/neutron/tests/unit/agent/common/test_config.py b/neutron/tests/unit/conf/agent/test_common.py
index b5a580e..b5053bf 100644
--- a/neutron/tests/unit/agent/common/test_config.py
+++ b/neutron/tests/unit/conf/agent/test_common.py
@@ -13,7 +13,7 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16from neutron.agent.common import config 16from neutron.conf.agent import common as config
17from neutron.tests import base 17from neutron.tests import base
18 18
19 19
diff --git a/neutron/tests/unit/debug/test_commands.py b/neutron/tests/unit/debug/test_commands.py
index d564c0f..2876f50 100644
--- a/neutron/tests/unit/debug/test_commands.py
+++ b/neutron/tests/unit/debug/test_commands.py
@@ -18,9 +18,9 @@ import socket
18import mock 18import mock
19from oslo_config import cfg 19from oslo_config import cfg
20 20
21from neutron.agent.common import config
22from neutron.agent.linux import interface 21from neutron.agent.linux import interface
23from neutron.common import config as common_config 22from neutron.common import config as common_config
23from neutron.conf.agent import common as config
24from neutron.debug import commands 24from neutron.debug import commands
25from neutron.debug import debug_agent 25from neutron.debug import debug_agent
26from neutron.extensions import portbindings 26from neutron.extensions import portbindings