# under the License.
#
-import sys
-
import eventlet
eventlet.monkey_patch()
from neutron.agent.l3 import ha
from neutron.agent.l3 import router_info
from neutron.agent.l3 import router_processing_queue as queue
-from neutron.agent.linux import external_process
-from neutron.agent.linux import interface
from neutron.agent.linux import ip_lib
from neutron.agent.linux import ra
from neutron.agent.metadata import driver as metadata_driver
from neutron.agent import rpc as agent_rpc
-from neutron.common import config as common_config
from neutron.common import constants as l3_constants
from neutron.common import exceptions as n_exc
from neutron.common import ipv6_utils
from neutron.openstack.common import log as logging
from neutron.openstack.common import loopingcall
from neutron.openstack.common import periodic_task
-from neutron.openstack.common import service
-from neutron import service as neutron_service
from neutron.services import advanced_service as adv_svc
try:
from neutron_fwaas.services.firewall.agents.l3reference \
"""
target = messaging.Target(version='1.2')
- OPTS = [
- cfg.StrOpt('agent_mode', default='legacy',
- help=_("The working mode for the agent. Allowed modes are: "
- "'legacy' - this preserves the existing behavior "
- "where the L3 agent is deployed on a centralized "
- "networking node to provide L3 services like DNAT, "
- "and SNAT. Use this mode if you do not want to "
- "adopt DVR. 'dvr' - this mode enables DVR "
- "functionality and must be used for an L3 agent "
- "that runs on a compute host. 'dvr_snat' - this "
- "enables centralized SNAT support in conjunction "
- "with DVR. This mode must be used for an L3 agent "
- "running on a centralized node (or in single-host "
- "deployments, e.g. devstack)")),
- cfg.StrOpt('external_network_bridge', default='br-ex',
- help=_("Name of bridge used for external network "
- "traffic.")),
- cfg.IntOpt('metadata_port',
- default=9697,
- help=_("TCP Port used by Neutron metadata namespace "
- "proxy.")),
- cfg.IntOpt('send_arp_for_ha',
- default=3,
- help=_("Send this many gratuitous ARPs for HA setup, if "
- "less than or equal to 0, the feature is disabled")),
- cfg.StrOpt('router_id', default='',
- help=_("If namespaces is disabled, the l3 agent can only"
- " configure a router that has the matching router "
- "ID.")),
- cfg.BoolOpt('handle_internal_only_routers',
- default=True,
- help=_("Agent should implement routers with no gateway")),
- cfg.StrOpt('gateway_external_network_id', default='',
- help=_("UUID of external network for routers implemented "
- "by the agents.")),
- cfg.BoolOpt('enable_metadata_proxy', default=True,
- help=_("Allow running metadata proxy.")),
- cfg.BoolOpt('router_delete_namespaces', default=False,
- help=_("Delete namespace after removing a router.")),
- cfg.StrOpt('metadata_proxy_socket',
- default='$state_path/metadata_proxy',
- help=_('Location of Metadata Proxy UNIX domain '
- 'socket')),
- cfg.StrOpt('metadata_proxy_user',
- default='',
- help=_("User (uid or name) running metadata proxy after "
- "its initialization (if empty: L3 agent effective "
- "user)")),
- cfg.StrOpt('metadata_proxy_group',
- default='',
- help=_("Group (gid or name) running metadata proxy after "
- "its initialization (if empty: L3 agent effective "
- "group)"))
- ]
-
def __init__(self, host, conf=None):
if conf:
self.conf = conf
LOG.info(_LI("agent_updated by server side %s!"), payload)
-def _register_opts(conf):
- conf.register_opts(L3NATAgent.OPTS)
- conf.register_opts(ha.OPTS)
- config.register_interface_driver_opts_helper(conf)
- config.register_use_namespaces_opts_helper(conf)
- config.register_agent_state_opts_helper(conf)
- config.register_root_helper(conf)
- conf.register_opts(interface.OPTS)
- conf.register_opts(external_process.OPTS)
-
-
-def main(manager='neutron.agent.l3.agent.L3NATAgentWithStateReport'):
- _register_opts(cfg.CONF)
- common_config.init(sys.argv[1:])
- config.setup_logging()
- server = neutron_service.Service.create(
- binary='neutron-l3-agent',
- topic=topics.L3_AGENT,
- report_interval=cfg.CONF.AGENT.report_interval,
- manager=manager)
- service.launch(server).wait()
+# TODO(armax): drop as soon as dependent services are updated
+from neutron.agent import l3_agent
+main = l3_agent.main
--- /dev/null
+# Copyright (c) 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
+
+
+OPTS = [
+ cfg.StrOpt('agent_mode', default='legacy',
+ help=_("The working mode for the agent. Allowed modes are: "
+ "'legacy' - this preserves the existing behavior "
+ "where the L3 agent is deployed on a centralized "
+ "networking node to provide L3 services like DNAT, "
+ "and SNAT. Use this mode if you do not want to "
+ "adopt DVR. 'dvr' - this mode enables DVR "
+ "functionality and must be used for an L3 agent "
+ "that runs on a compute host. 'dvr_snat' - this "
+ "enables centralized SNAT support in conjunction "
+ "with DVR. This mode must be used for an L3 agent "
+ "running on a centralized node (or in single-host "
+ "deployments, e.g. devstack)")),
+ cfg.StrOpt('external_network_bridge', default='br-ex',
+ help=_("Name of bridge used for external network "
+ "traffic.")),
+ cfg.IntOpt('metadata_port',
+ default=9697,
+ help=_("TCP Port used by Neutron metadata namespace "
+ "proxy.")),
+ cfg.IntOpt('send_arp_for_ha',
+ default=3,
+ help=_("Send this many gratuitous ARPs for HA setup, if "
+ "less than or equal to 0, the feature is disabled")),
+ cfg.StrOpt('router_id', default='',
+ help=_("If namespaces is disabled, the l3 agent can only"
+ " configure a router that has the matching router "
+ "ID.")),
+ cfg.BoolOpt('handle_internal_only_routers',
+ default=True,
+ help=_("Agent should implement routers with no gateway")),
+ cfg.StrOpt('gateway_external_network_id', default='',
+ help=_("UUID of external network for routers implemented "
+ "by the agents.")),
+ cfg.BoolOpt('enable_metadata_proxy', default=True,
+ help=_("Allow running metadata proxy.")),
+ cfg.BoolOpt('router_delete_namespaces', default=False,
+ help=_("Delete namespace after removing a router.")),
+ cfg.StrOpt('metadata_proxy_socket',
+ default='$state_path/metadata_proxy',
+ help=_('Location of Metadata Proxy UNIX domain '
+ 'socket')),
+ cfg.StrOpt('metadata_proxy_user',
+ default='',
+ help=_("User (uid or name) running metadata proxy after "
+ "its initialization (if empty: L3 agent effective "
+ "user)")),
+ cfg.StrOpt('metadata_proxy_group',
+ default='',
+ help=_("Group (gid or name) running metadata proxy after "
+ "its initialization (if empty: L3 agent effective "
+ "group)"))
+]
--- /dev/null
+# Copyright (c) 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.
+
+import sys
+
+from oslo.config import cfg
+
+from neutron.agent.common import config
+from neutron.agent.l3 import config as l3_config
+from neutron.agent.l3 import ha
+from neutron.agent.linux import external_process
+from neutron.agent.linux import interface
+from neutron.common import config as common_config
+from neutron.common import topics
+from neutron.openstack.common import service
+from neutron import service as neutron_service
+
+
+def register_opts(conf):
+ conf.register_opts(l3_config.OPTS)
+ conf.register_opts(ha.OPTS)
+ config.register_interface_driver_opts_helper(conf)
+ config.register_use_namespaces_opts_helper(conf)
+ config.register_agent_state_opts_helper(conf)
+ config.register_root_helper(conf)
+ conf.register_opts(interface.OPTS)
+ conf.register_opts(external_process.OPTS)
+
+
+def main(manager='neutron.agent.l3.agent.L3NATAgentWithStateReport'):
+ register_opts(cfg.CONF)
+ common_config.init(sys.argv[1:])
+ config.setup_logging()
+ server = neutron_service.Service.create(
+ binary='neutron-l3-agent',
+ topic=topics.L3_AGENT,
+ report_interval=cfg.CONF.AGENT.report_interval,
+ manager=manager)
+ service.launch(server).wait()
from oslo.config import cfg
from neutron.agent.common import config as agent_config
-from neutron.agent.l3 import agent
+from neutron.agent.l3 import config as l3_config
from neutron.agent.linux import interface
from neutron.agent.linux import ip_lib
from neutron.agent.linux import ovs_lib
conf = cfg.CONF
conf.register_cli_opts(opts)
- conf.register_opts(agent.L3NATAgent.OPTS)
+ conf.register_opts(l3_config.OPTS)
conf.register_opts(interface.OPTS)
agent_config.register_interface_driver_opts_helper(conf)
agent_config.register_use_namespaces_opts_helper(conf)
from neutron.agent.common import config as agent_config
from neutron.agent.l3 import agent as l3_agent
+from neutron.agent import l3_agent as l3_agent_main
from neutron.agent.linux import dhcp
from neutron.agent.linux import external_process
from neutron.agent.linux import ip_lib
def _configure_agent(self, host):
conf = self._get_config_opts()
- l3_agent._register_opts(conf)
+ l3_agent_main.register_opts(conf)
cfg.CONF.set_override('debug', False)
agent_config.setup_logging()
conf.set_override(
from oslo.config import cfg
from neutron.agent.common import config as agent_config
-from neutron.agent.l3 import agent as l3_agent
+from neutron.agent.l3 import config as l3_config
from neutron.agent.metadata import driver as metadata_driver
from neutron.openstack.common import uuidutils
from neutron.tests import base
def setUp(self):
super(TestMetadataDriver, self).setUp()
- cfg.CONF.register_opts(l3_agent.L3NATAgent.OPTS)
+ cfg.CONF.register_opts(l3_config.OPTS)
agent_config.register_root_helper(cfg.CONF)
def test_metadata_nat_rules(self):
from neutron.agent.common import config as agent_config
from neutron.agent.l3 import agent as l3_agent
+from neutron.agent.l3 import config as l3_config
from neutron.agent.l3 import dvr
from neutron.agent.l3 import ha
from neutron.agent.l3 import link_local_allocator as lla
self.conf.register_opts(base_config.core_opts)
self.conf.register_cli_opts(log.common_cli_opts)
self.conf.register_cli_opts(log.logging_cli_opts)
- self.conf.register_opts(l3_agent.L3NATAgent.OPTS)
+ self.conf.register_opts(l3_config.OPTS)
self.conf.register_opts(ha.OPTS)
agent_config.register_interface_driver_opts_helper(self.conf)
agent_config.register_use_namespaces_opts_helper(self.conf)
neutron-dhcp-agent = neutron.agent.dhcp_agent:main
neutron-hyperv-agent = neutron.plugins.hyperv.agent.hyperv_neutron_agent:main
neutron-ibm-agent = neutron.plugins.ibm.agent.sdnve_neutron_agent:main
- neutron-l3-agent = neutron.agent.l3.agent:main
+ neutron-l3-agent = neutron.agent.l3_agent:main
neutron-linuxbridge-agent = neutron.plugins.linuxbridge.agent.linuxbridge_neutron_agent:main
neutron-metadata-agent = neutron.agent.metadata.agent:main
neutron-mlnx-agent = neutron.plugins.mlnx.agent.eswitch_neutron_agent:main