Skip to content

Commit

Permalink
DHCP agent restructuring
Browse files Browse the repository at this point in the history
Wrap dhcp agent into its own module and break out configurations and
entry point for better seperation. This lead to some test cleanup
that revealed that options were registered unnecessarily.

When/if the dhcp agent goes through a restructuring along the same
lines of the L3 agent's, this would be the step to start from.

Related-blueprint: restructure-l3-agent
Related-blueprint: core-vendor-decomposition

Change-Id: I87d9f1079ed4e71c731984ec00e2f785024fd5f8
  • Loading branch information
armando-migliaccio committed Jan 17, 2015
1 parent 6870733 commit b35c004
Show file tree
Hide file tree
Showing 11 changed files with 688 additions and 645 deletions.
4 changes: 2 additions & 2 deletions doc/source/devref/rpc_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ that indicates where the corresponding server or client code is located.
Example: DHCP
-------------

The DHCP agent includes a client API, neutron.agent.dhcp_agent.DhcpPluginAPI.
The DHCP agent includes a client API, neutron.agent.dhcp.agent.DhcpPluginAPI.
The DHCP agent uses this class to call remote methods back in the Neutron
server. The server side is defined in
neutron.api.rpc.handlers.dhcp_rpc.DhcpRpcCallback. It is up to the Neutron
Expand All @@ -165,7 +165,7 @@ Similarly, there is an RPC interface defined that allows the Neutron plugin to
remotely invoke methods in the DHCP agent. The client side is defined in
neutron.api.rpc.agentnotifiers.dhcp_rpc_agent_api.DhcpAgentNotifyApi. The
server side of this interface that runs in the DHCP agent is
neutron.agent.dhcp_agent.DhcpAgent.
neutron.agent.dhcp.agent.DhcpAgent.

More Info
=========
Expand Down
Empty file added neutron/agent/dhcp/__init__.py
Empty file.
596 changes: 596 additions & 0 deletions neutron/agent/dhcp/agent.py

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions neutron/agent/dhcp/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright 2015 OpenStack Foundation
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

from oslo.config import cfg

DHCP_AGENT_OPTS = [
cfg.IntOpt('resync_interval', default=5,
help=_("Interval to resync.")),
cfg.StrOpt('dhcp_driver',
default='neutron.agent.linux.dhcp.Dnsmasq',
help=_("The driver used to manage the DHCP server.")),
cfg.BoolOpt('enable_isolated_metadata', default=False,
help=_("Support Metadata requests on isolated networks.")),
cfg.BoolOpt('enable_metadata_network', default=False,
help=_("Allows for serving metadata requests from a "
"dedicated network. Requires "
"enable_isolated_metadata = True")),
cfg.IntOpt('num_sync_threads', default=4,
help=_('Number of threads to use during sync process.')),
cfg.StrOpt('metadata_proxy_socket',
default='$state_path/metadata_proxy',
help=_('Location of Metadata Proxy UNIX domain '
'socket')),
]

DHCP_OPTS = [
cfg.StrOpt('dhcp_confs',
default='$state_path/dhcp',
help=_('Location to store DHCP server config files')),
cfg.StrOpt('dhcp_domain',
default='openstacklocal',
help=_('Domain to use for building the hostnames')),
]

DNSMASQ_OPTS = [
cfg.StrOpt('dnsmasq_config_file',
default='',
help=_('Override the default dnsmasq settings with this file')),
cfg.ListOpt('dnsmasq_dns_servers',
help=_('Comma-separated list of the DNS servers which will be '
'used as forwarders.'),
deprecated_name='dnsmasq_dns_server'),
cfg.BoolOpt('dhcp_delete_namespaces', default=False,
help=_("Delete namespace after removing a dhcp server.")),
cfg.IntOpt(
'dnsmasq_lease_max',
default=(2 ** 24),
help=_('Limit number of leases to prevent a denial-of-service.')),
cfg.BoolOpt('dhcp_broadcast_reply', default=False,
help=_("Use broadcast in DHCP replies")),
]
Loading

0 comments on commit b35c004

Please sign in to comment.