FWaaS v2 agent extension supporting L3 ports and interfaces with the FWaaS v2 plugin and the FWaaS v2 driver. Partial-Implements: blueprint fwaas-api-2.0 Co-Authored-By: Chandan Dutta Chowdhury <chandanc@juniper.net> Co-Authored-By: Nate Johnston <Nate_Johnston@cable.comcast.com> Depends-on: Ia923cf1c1abb2dae18370215e16a6f896671392b Change-Id: Iff506bd11b83d396305e631f3dd95d44cf38fd63
63 lines
2.3 KiB
Python
63 lines
2.3 KiB
Python
# 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 oslo_service import service
|
|
|
|
from neutron.agent.common import config
|
|
from neutron.agent.l3 import ha
|
|
from neutron.agent.linux import external_process
|
|
from neutron.agent.linux import interface
|
|
from neutron.agent.linux import pd
|
|
from neutron.agent.linux import ra
|
|
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.l3 import config as l3_config
|
|
from neutron import service as neutron_service
|
|
from neutron_fwaas.services.firewall.agents import firewall_agent_api as fwa
|
|
|
|
|
|
FWAAS_AGENTS = {fwa.FWAAS_V1: ('neutron_fwaas.services.firewall.agents.'
|
|
'l3reference.firewall_l3_agent.L3WithFWaaS'),
|
|
fwa.FWAAS_V2: ('neutron_fwaas.services.firewall.agents.'
|
|
'l3reference.firewall_l3_agent_v2.L3WithFWaaS')}
|
|
|
|
|
|
def register_opts(conf):
|
|
conf.register_opts(l3_config.OPTS)
|
|
conf.register_opts(metadata_config.DRIVER_OPTS)
|
|
conf.register_opts(metadata_config.SHARED_OPTS)
|
|
conf.register_opts(ha.OPTS)
|
|
config.register_interface_driver_opts_helper(conf)
|
|
config.register_agent_state_opts_helper(conf)
|
|
conf.register_opts(interface.OPTS)
|
|
conf.register_opts(external_process.OPTS)
|
|
conf.register_opts(pd.OPTS)
|
|
conf.register_opts(ra.OPTS)
|
|
config.register_availability_zone_opts_helper(conf)
|
|
|
|
|
|
def main():
|
|
register_opts(cfg.CONF)
|
|
common_config.init(sys.argv[1:])
|
|
config.setup_logging()
|
|
manager = FWAAS_AGENTS[cfg.CONF.fwaas.agent_version]
|
|
server = neutron_service.Service.create(
|
|
binary='neutron-l3-agent',
|
|
topic=topics.L3_AGENT,
|
|
report_interval=cfg.CONF.AGENT.report_interval,
|
|
manager=manager)
|
|
service.launch(cfg.CONF, server).wait()
|