Refactoring config options for dhcp agent
Refactoring neutron configuration options for dhcp agent to be in neutron/conf/agent. This would allow centralization of all configuration options and provide an easy way to import. Change-Id: Ia17d2d7223dd598e2d36a8320942fb03b61dffaf Partial-Bug: #1563069
This commit is contained in:
parent
0ad114ab80
commit
607957ef35
|
@ -20,11 +20,11 @@ from oslo_config import cfg
|
|||
from oslo_service import service
|
||||
|
||||
from neutron.agent.common import config
|
||||
from neutron.agent.dhcp import config as dhcp_config
|
||||
from neutron.agent.linux import interface
|
||||
from neutron.agent.metadata import config as metadata_config
|
||||
from neutron.common import config as common_config
|
||||
from neutron.common import topics
|
||||
from neutron.conf.agent import dhcp as dhcp_config
|
||||
from neutron import service as neutron_service
|
||||
|
||||
|
||||
|
@ -32,9 +32,7 @@ def register_options(conf):
|
|||
config.register_interface_driver_opts_helper(conf)
|
||||
config.register_agent_state_opts_helper(conf)
|
||||
config.register_availability_zone_opts_helper(conf)
|
||||
conf.register_opts(dhcp_config.DHCP_AGENT_OPTS)
|
||||
conf.register_opts(dhcp_config.DHCP_OPTS)
|
||||
conf.register_opts(dhcp_config.DNSMASQ_OPTS)
|
||||
dhcp_config.register_agent_dhcp_opts(conf)
|
||||
conf.register_opts(metadata_config.DRIVER_OPTS)
|
||||
conf.register_opts(metadata_config.SHARED_OPTS)
|
||||
conf.register_opts(interface.OPTS)
|
||||
|
|
|
@ -25,7 +25,6 @@ from oslo_utils import importutils
|
|||
from neutron._i18n import _, _LE
|
||||
from neutron.agent.common import config as agent_config
|
||||
from neutron.agent.common import ovs_lib
|
||||
from neutron.agent.dhcp import config as dhcp_config
|
||||
from neutron.agent.l3 import agent as l3_agent
|
||||
from neutron.agent.l3 import dvr
|
||||
from neutron.agent.l3 import dvr_fip_ns
|
||||
|
@ -34,6 +33,7 @@ from neutron.agent.linux import external_process
|
|||
from neutron.agent.linux import interface
|
||||
from neutron.agent.linux import ip_lib
|
||||
from neutron.common import config
|
||||
from neutron.conf.agent import dhcp as dhcp_config
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -72,9 +72,7 @@ def setup_conf():
|
|||
conf = cfg.CONF
|
||||
conf.register_cli_opts(cli_opts)
|
||||
agent_config.register_interface_driver_opts_helper(conf)
|
||||
conf.register_opts(dhcp_config.DHCP_AGENT_OPTS)
|
||||
conf.register_opts(dhcp_config.DHCP_OPTS)
|
||||
conf.register_opts(dhcp_config.DNSMASQ_OPTS)
|
||||
dhcp_config.register_agent_dhcp_opts(conf)
|
||||
conf.register_opts(interface.OPTS)
|
||||
return conf
|
||||
|
||||
|
|
|
@ -14,10 +14,12 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from neutron._i18n import _
|
||||
|
||||
|
||||
DHCP_AGENT_OPTS = [
|
||||
cfg.IntOpt('resync_interval', default=5,
|
||||
help=_("The DHCP agent will resync its state with Neutron to "
|
||||
|
@ -100,3 +102,9 @@ DNSMASQ_OPTS = [
|
|||
cfg.BoolOpt('dhcp_broadcast_reply', default=False,
|
||||
help=_("Use broadcast in DHCP replies.")),
|
||||
]
|
||||
|
||||
|
||||
def register_agent_dhcp_opts(cfg=cfg.CONF):
|
||||
cfg.register_opts(DHCP_AGENT_OPTS)
|
||||
cfg.register_opts(DHCP_OPTS)
|
||||
cfg.register_opts(DNSMASQ_OPTS)
|
|
@ -19,7 +19,6 @@ from oslo_config import cfg
|
|||
|
||||
import neutron.agent.common.config
|
||||
import neutron.agent.common.ovs_lib
|
||||
import neutron.agent.dhcp.config
|
||||
import neutron.agent.l2.extensions.manager
|
||||
import neutron.agent.l3.config
|
||||
import neutron.agent.l3.ha
|
||||
|
@ -30,6 +29,7 @@ import neutron.agent.metadata.config
|
|||
import neutron.agent.ovsdb.api
|
||||
import neutron.agent.securitygroups_rpc
|
||||
import neutron.common.cache_utils
|
||||
import neutron.conf.agent.dhcp
|
||||
import neutron.conf.quota
|
||||
import neutron.conf.service
|
||||
import neutron.db.agents_db
|
||||
|
@ -169,9 +169,9 @@ def list_dhcp_agent_opts():
|
|||
return [
|
||||
('DEFAULT',
|
||||
itertools.chain(
|
||||
neutron.agent.dhcp.config.DHCP_AGENT_OPTS,
|
||||
neutron.agent.dhcp.config.DHCP_OPTS,
|
||||
neutron.agent.dhcp.config.DNSMASQ_OPTS)
|
||||
neutron.conf.agent.dhcp.DHCP_AGENT_OPTS,
|
||||
neutron.conf.agent.dhcp.DHCP_OPTS,
|
||||
neutron.conf.agent.dhcp.DNSMASQ_OPTS)
|
||||
)
|
||||
]
|
||||
|
||||
|
|
|
@ -16,11 +16,11 @@ import mock
|
|||
from oslo_config import cfg
|
||||
|
||||
from neutron.agent.common import config
|
||||
from neutron.agent.dhcp import config as dhcp_conf
|
||||
from neutron.agent.linux import dhcp
|
||||
from neutron.agent.linux import interface
|
||||
from neutron.agent.linux import ip_lib
|
||||
from neutron.common import config as common_conf
|
||||
from neutron.conf.agent import dhcp as dhcp_conf
|
||||
from neutron.tests import base as tests_base
|
||||
from neutron.tests.common import net_helpers
|
||||
from neutron.tests.functional import base as functional_base
|
||||
|
|
|
@ -28,13 +28,13 @@ import testtools
|
|||
|
||||
from neutron.agent.common import config
|
||||
from neutron.agent.dhcp import agent as dhcp_agent
|
||||
from neutron.agent.dhcp import config as dhcp_config
|
||||
from neutron.agent import dhcp_agent as entry
|
||||
from neutron.agent.linux import dhcp
|
||||
from neutron.agent.linux import interface
|
||||
from neutron.common import config as common_config
|
||||
from neutron.common import constants as n_const
|
||||
from neutron.common import utils
|
||||
from neutron.conf.agent import dhcp as dhcp_config
|
||||
from neutron import context
|
||||
from neutron.tests import base
|
||||
|
||||
|
|
|
@ -21,12 +21,12 @@ from neutron_lib import constants
|
|||
from oslo_config import cfg
|
||||
|
||||
from neutron.agent.common import config
|
||||
from neutron.agent.dhcp import config as dhcp_config
|
||||
from neutron.agent.linux import dhcp
|
||||
from neutron.agent.linux import external_process
|
||||
from neutron.common import config as base_config
|
||||
from neutron.common import constants as n_const
|
||||
from neutron.common import utils
|
||||
from neutron.conf.agent import dhcp as dhcp_config
|
||||
from neutron.extensions import extra_dhcp_opt as edo_ext
|
||||
from neutron.tests import base
|
||||
from neutron.tests import tools
|
||||
|
|
Loading…
Reference in New Issue