Implements oslo conf generator
Change-Id: Ifca462b686ea914db5861880f23adde311fb4bb9 Implements: blueprint oslo-config-generator Closes-Bug: #1523510
This commit is contained in:
parent
9ff6a29c04
commit
bf7a2176fb
|
@ -62,3 +62,6 @@ ChangeLog
|
|||
|
||||
# Ext services
|
||||
devstack/df-ext-services.sh
|
||||
|
||||
# Configurations
|
||||
etc/*.sample
|
||||
|
|
13
README.rst
13
README.rst
|
@ -105,3 +105,16 @@ In planning
|
|||
* Distributed FWaaS
|
||||
* Distributed SNAT
|
||||
* VPNaaS
|
||||
|
||||
Configurations
|
||||
==============
|
||||
|
||||
To generate the sample dragonflow configuration files, run the following
|
||||
command from the top level of the dragonflow directory:
|
||||
|
||||
tox -e genconfig
|
||||
|
||||
If a 'tox' environment is unavailable, then you can run the following script
|
||||
instead to generate the configuration files:
|
||||
|
||||
./tools/generate_config_file_samples.sh
|
||||
|
|
|
@ -19,3 +19,8 @@ if is_service_enabled df-l3-agent ; then
|
|||
AGENT_L3_BINARY=${AGENT_L3_BINARY:-"df-l3-agent"}
|
||||
enable_service q-l3
|
||||
fi
|
||||
|
||||
DRAGONFLOW_CONF=/etc/neutron/plugins/dragonflow.ini
|
||||
Q_PLUGIN_EXTRA_CONF_PATH=/etc/neutron/plugins
|
||||
Q_PLUGIN_EXTRA_CONF_FILES=(dragonflow.ini)
|
||||
NEUTRON_CONFIG_ARG+=" --config-file $DRAGONFLOW_CONF"
|
||||
|
|
|
@ -47,8 +47,8 @@ function _configure_ovs_dpdk {
|
|||
OVS_DATAPATH_TYPE=netdev
|
||||
|
||||
# Configure user space datapath
|
||||
iniset $NEUTRON_CONF df vif_type vhostuser
|
||||
iniset $NEUTRON_CONF df vhost_sock_dir ${OVS_DIR}
|
||||
iniset $DRAGONFLOW_CONF df vif_type vhostuser
|
||||
iniset $DRAGONFLOW_CONF df vhost_sock_dir ${OVS_DIR}
|
||||
|
||||
# Disable kernel TCP/IP stack
|
||||
sudo iptables -A INPUT -i ${DPDK_NIC_NAME} -j DROP
|
||||
|
|
|
@ -135,9 +135,9 @@ function configure_df_metadata_service {
|
|||
iniset $NOVA_CONF neutron service_metadata_proxy True
|
||||
iniset $NOVA_CONF neutron metadata_proxy_shared_secret $METADATA_PROXY_SHARED_SECRET
|
||||
iniset $NEUTRON_CONF DEFAULT metadata_proxy_shared_secret $METADATA_PROXY_SHARED_SECRET
|
||||
iniset $NEUTRON_CONF df_metadata ip "$DF_METADATA_SERVICE_IP"
|
||||
iniset $NEUTRON_CONF df_metadata port "$DF_METADATA_SERVICE_PORT"
|
||||
iniset $NEUTRON_CONF df metadata_interface "$DF_METADATA_SERVICE_INTERFACE"
|
||||
iniset $DRAGONFLOW_CONF df_metadata ip "$DF_METADATA_SERVICE_IP"
|
||||
iniset $DRAGONFLOW_CONF df_metadata port "$DF_METADATA_SERVICE_PORT"
|
||||
iniset $DRAGONFLOW_CONF df metadata_interface "$DF_METADATA_SERVICE_INTERFACE"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -158,30 +158,35 @@ function configure_df_plugin {
|
|||
DF_APPS_LIST=$ML2_APPS_LIST
|
||||
fi
|
||||
|
||||
NEUTRON_CONF=/etc/neutron/neutron.conf
|
||||
iniset $NEUTRON_CONF df remote_db_ip "$REMOTE_DB_IP"
|
||||
iniset $NEUTRON_CONF df remote_db_port $REMOTE_DB_PORT
|
||||
iniset $NEUTRON_CONF df remote_db_hosts "$REMOTE_DB_HOSTS"
|
||||
iniset $NEUTRON_CONF df nb_db_class "$NB_DRIVER_CLASS"
|
||||
iniset $NEUTRON_CONF df local_ip "$HOST_IP"
|
||||
iniset $NEUTRON_CONF df tunnel_type "$TUNNEL_TYPE"
|
||||
iniset $NEUTRON_CONF df integration_bridge "$INTEGRATION_BRIDGE"
|
||||
iniset $NEUTRON_CONF df apps_list "$DF_APPS_LIST"
|
||||
iniset $NEUTRON_CONF df monitor_table_poll_time "$DF_MONITOR_TABLE_POLL_TIME"
|
||||
iniset $NEUTRON_CONF df_l2_app l2_responder "$DF_L2_RESPONDER"
|
||||
iniset $NEUTRON_CONF df enable_df_pub_sub "$DF_PUB_SUB"
|
||||
iniset $NEUTRON_CONF df pub_sub_use_multiproc "$DF_PUB_SUB_USE_MULTIPROC"
|
||||
iniset $NEUTRON_CONF df publisher_rate_limit_timeout "$PUBLISHER_RATE_LIMIT_TIMEOUT"
|
||||
iniset $NEUTRON_CONF df publisher_rate_limit_count "$PUBLISHER_RATE_LIMIT_COUNT"
|
||||
iniset $NEUTRON_CONF df_dnat_app external_network_bridge "$PUBLIC_BRIDGE"
|
||||
iniset $NEUTRON_CONF df_dnat_app int_peer_patch_port "$INTEGRATION_PEER_PORT"
|
||||
iniset $NEUTRON_CONF df_dnat_app ex_peer_patch_port "$PUBLIC_PEER_PORT"
|
||||
# Generate configuration file
|
||||
local _pwd=$(pwd)
|
||||
(cd $DRAGONFLOW_DIR && exec ./tools/generate_config_file_samples.sh)
|
||||
cd $_pwd
|
||||
cp $DRAGONFLOW_DIR/etc/dragonflow.ini.sample $DRAGONFLOW_CONF
|
||||
|
||||
iniset $DRAGONFLOW_CONF df remote_db_ip "$REMOTE_DB_IP"
|
||||
iniset $DRAGONFLOW_CONF df remote_db_port $REMOTE_DB_PORT
|
||||
iniset $DRAGONFLOW_CONF df remote_db_hosts "$REMOTE_DB_HOSTS"
|
||||
iniset $DRAGONFLOW_CONF df nb_db_class "$NB_DRIVER_CLASS"
|
||||
iniset $DRAGONFLOW_CONF df local_ip "$HOST_IP"
|
||||
iniset $DRAGONFLOW_CONF df tunnel_type "$TUNNEL_TYPE"
|
||||
iniset $DRAGONFLOW_CONF df integration_bridge "$INTEGRATION_BRIDGE"
|
||||
iniset $DRAGONFLOW_CONF df apps_list "$DF_APPS_LIST"
|
||||
iniset $DRAGONFLOW_CONF df monitor_table_poll_time "$DF_MONITOR_TABLE_POLL_TIME"
|
||||
iniset $DRAGONFLOW_CONF df_l2_app l2_responder "$DF_L2_RESPONDER"
|
||||
iniset $DRAGONFLOW_CONF df enable_df_pub_sub "$DF_PUB_SUB"
|
||||
iniset $DRAGONFLOW_CONF df pub_sub_use_multiproc "$DF_PUB_SUB_USE_MULTIPROC"
|
||||
iniset $DRAGONFLOW_CONF df publisher_rate_limit_timeout "$PUBLISHER_RATE_LIMIT_TIMEOUT"
|
||||
iniset $DRAGONFLOW_CONF df publisher_rate_limit_count "$PUBLISHER_RATE_LIMIT_COUNT"
|
||||
iniset $DRAGONFLOW_CONF df_dnat_app external_network_bridge "$PUBLIC_BRIDGE"
|
||||
iniset $DRAGONFLOW_CONF df_dnat_app int_peer_patch_port "$INTEGRATION_PEER_PORT"
|
||||
iniset $DRAGONFLOW_CONF df_dnat_app ex_peer_patch_port "$PUBLIC_PEER_PORT"
|
||||
iniset $NEUTRON_CONF DEFAULT advertise_mtu "True"
|
||||
iniset $NEUTRON_CONF DEFAULT core_plugin "$Q_PLUGIN_CLASS"
|
||||
iniset $NEUTRON_CONF DEFAULT service_plugins "$Q_SERVICE_PLUGIN_CLASSES"
|
||||
|
||||
if is_service_enabled q-dhcp ; then
|
||||
iniset $NEUTRON_CONF df use_centralized_ipv6_DHCP "True"
|
||||
iniset $DRAGONFLOW_CONF df use_centralized_ipv6_DHCP "True"
|
||||
else
|
||||
iniset $NEUTRON_CONF DEFAULT dhcp_agent_notification "False"
|
||||
fi
|
||||
|
@ -191,7 +196,7 @@ function configure_df_plugin {
|
|||
else
|
||||
DF_SELECTIVE_TOPO_DIST="False"
|
||||
fi
|
||||
iniset $NEUTRON_CONF df enable_selective_topology_distribution \
|
||||
iniset $DRAGONFLOW_CONF df enable_selective_topology_distribution \
|
||||
"$DF_SELECTIVE_TOPO_DIST"
|
||||
|
||||
if [[ "$DF_RUNNING_IN_GATE" == "True" ]]; then
|
||||
|
@ -212,32 +217,32 @@ function configure_df_plugin {
|
|||
# neutron-lib, but we don't call that for compute nodes here.
|
||||
# Uses oslo config generator to generate core sample configuration files
|
||||
local _pwd=$(pwd)
|
||||
NEUTRON_CONF=/etc/neutron/neutron.conf
|
||||
(cd $NEUTRON_DIR && exec ./tools/generate_config_file_samples.sh)
|
||||
(cd $DRAGONFLOW_DIR && exec ./tools/generate_config_file_samples.sh)
|
||||
cd $_pwd
|
||||
|
||||
cp $NEUTRON_DIR/etc/neutron.conf.sample $NEUTRON_CONF
|
||||
cp $DRAGONFLOW_DIR/etc/dragonflow.ini.sample $DRAGONFLOW_CONF
|
||||
|
||||
iniset $NEUTRON_CONF df remote_db_ip "$REMOTE_DB_IP"
|
||||
iniset $NEUTRON_CONF df remote_db_port $REMOTE_DB_PORT
|
||||
iniset $NEUTRON_CONF df remote_db_hosts "$REMOTE_DB_HOSTS"
|
||||
iniset $NEUTRON_CONF df nb_db_class "$NB_DRIVER_CLASS"
|
||||
iniset $NEUTRON_CONF df local_ip "$HOST_IP"
|
||||
iniset $NEUTRON_CONF df tunnel_type "$TUNNEL_TYPE"
|
||||
iniset $NEUTRON_CONF df integration_bridge "$INTEGRATION_BRIDGE"
|
||||
iniset $NEUTRON_CONF df apps_list "$DF_APPS_LIST"
|
||||
iniset $NEUTRON_CONF df_l2_app l2_responder "$DF_L2_RESPONDER"
|
||||
iniset $NEUTRON_CONF df enable_df_pub_sub "$DF_PUB_SUB"
|
||||
iniset $NEUTRON_CONF df_dnat_app external_network_bridge "$PUBLIC_BRIDGE"
|
||||
iniset $NEUTRON_CONF df_dnat_app int_peer_patch_port "$INTEGRATION_PEER_PORT"
|
||||
iniset $NEUTRON_CONF df_dnat_app ex_peer_patch_port "$PUBLIC_PEER_PORT"
|
||||
iniset $DRAGONFLOW_CONF df remote_db_ip "$REMOTE_DB_IP"
|
||||
iniset $DRAGONFLOW_CONF df remote_db_port $REMOTE_DB_PORT
|
||||
iniset $DRAGONFLOW_CONF df remote_db_hosts "$REMOTE_DB_HOSTS"
|
||||
iniset $DRAGONFLOW_CONF df nb_db_class "$NB_DRIVER_CLASS"
|
||||
iniset $DRAGONFLOW_CONF df local_ip "$HOST_IP"
|
||||
iniset $DRAGONFLOW_CONF df tunnel_type "$TUNNEL_TYPE"
|
||||
iniset $DRAGONFLOW_CONF df integration_bridge "$INTEGRATION_BRIDGE"
|
||||
iniset $DRAGONFLOW_CONF df apps_list "$DF_APPS_LIST"
|
||||
iniset $DRAGONFLOW_CONF df_l2_app l2_responder "$DF_L2_RESPONDER"
|
||||
iniset $DRAGONFLOW_CONF df enable_df_pub_sub "$DF_PUB_SUB"
|
||||
iniset $DRAGONFLOW_CONF df_dnat_app external_network_bridge "$PUBLIC_BRIDGE"
|
||||
iniset $DRAGONFLOW_CONF df_dnat_app int_peer_patch_port "$INTEGRATION_PEER_PORT"
|
||||
iniset $DRAGONFLOW_CONF df_dnat_app ex_peer_patch_port "$PUBLIC_PEER_PORT"
|
||||
|
||||
if [[ "$DF_PUB_SUB" == "True" ]]; then
|
||||
DF_SELECTIVE_TOPO_DIST=${DF_SELECTIVE_TOPO_DIST:-"True"}
|
||||
else
|
||||
DF_SELECTIVE_TOPO_DIST="False"
|
||||
fi
|
||||
iniset $NEUTRON_CONF df enable_selective_topology_distribution \
|
||||
iniset $DRAGONFLOW_CONF df enable_selective_topology_distribution \
|
||||
"$DF_SELECTIVE_TOPO_DIST"
|
||||
configure_df_metadata_service
|
||||
fi
|
||||
|
@ -356,7 +361,7 @@ function start_df {
|
|||
|
||||
if is_service_enabled df-controller ; then
|
||||
sudo ovs-vsctl --no-wait set-controller $INTEGRATION_BRIDGE tcp:127.0.0.1:6633
|
||||
run_process df-controller "$DF_LOCAL_CONTROLLER_BINARY --config-file $NEUTRON_CONF"
|
||||
run_process df-controller "$DF_LOCAL_CONTROLLER_BINARY --config-file $NEUTRON_CONF --config-file $DRAGONFLOW_CONF"
|
||||
run_process df-ext-services "bash $DEST/dragonflow/devstack/df-ext-services.sh"
|
||||
fi
|
||||
}
|
||||
|
@ -401,7 +406,7 @@ function verify_ryu_version {
|
|||
function start_pubsub_service {
|
||||
echo "Starting Dragonflow publisher service"
|
||||
if is_service_enabled df-publisher-service ; then
|
||||
run_process df-publisher-service "$DF_PUBLISHER_SERVICE_BINARY --config-file $NEUTRON_CONF"
|
||||
run_process df-publisher-service "$DF_PUBLISHER_SERVICE_BINARY --config-file $NEUTRON_CONF --config-file $DRAGONFLOW_CONF"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -414,7 +419,7 @@ function stop_pubsub_service {
|
|||
function start_df_metadata_agent {
|
||||
if is_service_enabled df-metadata ; then
|
||||
echo "Starting Dragonflow metadata service"
|
||||
run_process df-metadata "python $DF_METADATA_SERVICE --config-file $NEUTRON_CONF"
|
||||
run_process df-metadata "python $DF_METADATA_SERVICE --config-file $NEUTRON_CONF --config-file $DRAGONFLOW_CONF"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
function configure_pubsub_service_plugin {
|
||||
NEUTRON_CONF=${NEUTRON_CONF:-"/etc/neutron/neutron.conf"}
|
||||
PUB_SUB_DRIVER=${PUB_SUB_DRIVER:-"redis_db_pubsub_driver"}
|
||||
iniset $NEUTRON_CONF df pub_sub_driver $PUB_SUB_DRIVER
|
||||
}
|
||||
iniset $DRAGONFLOW_CONF df pub_sub_driver $PUB_SUB_DRIVER
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@ function configure_pubsub_service_plugin {
|
|||
NEUTRON_CONF=${NEUTRON_CONF:-"/etc/neutron/neutron.conf"}
|
||||
PUB_SUB_DRIVER=${PUB_SUB_DRIVER:-"zmq_pubsub_driver"}
|
||||
PUB_SUB_MULTIPROC_DRIVER=${PUB_SUB_MULTIPROC_DRIVER:-"zmq_pubsub_multiproc_driver"}
|
||||
iniset $NEUTRON_CONF df pub_sub_driver $PUB_SUB_DRIVER
|
||||
iniset $NEUTRON_CONF df pub_sub_multiproc_driver $PUB_SUB_MULTIPROC_DRIVER
|
||||
iniset $NEUTRON_CONF df publisher_multiproc_socket $ZMQ_IPC_SOCKET
|
||||
iniset $DRAGONFLOW_CONF df pub_sub_driver $PUB_SUB_DRIVER
|
||||
iniset $DRAGONFLOW_CONF df pub_sub_multiproc_driver $PUB_SUB_MULTIPROC_DRIVER
|
||||
iniset $DRAGONFLOW_CONF df publisher_multiproc_socket $ZMQ_IPC_SOCKET
|
||||
|
||||
ZMQ_IPC_SOCKET_DIR=`dirname $ZMQ_IPC_SOCKET`
|
||||
sudo mkdir -p $ZMQ_IPC_SOCKET_DIR
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
==============
|
||||
Configurations
|
||||
==============
|
||||
|
||||
Since Newton, configuration files should be generated as follows::
|
||||
|
||||
``tox -e genconfig``
|
||||
|
||||
If a 'tox' environment is unavailable, then you can run the following script
|
||||
instead to generate the configuration files::
|
||||
|
||||
./tools/generate_config_file_samples.sh
|
|
@ -21,6 +21,7 @@ Contents:
|
|||
pipeline
|
||||
containers
|
||||
gmr
|
||||
configuration
|
||||
usage
|
||||
features
|
||||
contributing
|
||||
|
|
|
@ -21,7 +21,7 @@ from dragonflow.common import common_params
|
|||
from dragonflow.common import exceptions as df_exceptions
|
||||
from dragonflow.common import utils as df_utils
|
||||
|
||||
cfg.CONF.register_opts(common_params.df_opts, 'df')
|
||||
cfg.CONF.register_opts(common_params.DF_OPTS, 'df')
|
||||
|
||||
db_tables = ['lport', 'lswitch', 'lrouter', 'chassis', 'secgroup',
|
||||
'tunnel_key', 'floatingip', 'publisher']
|
||||
|
@ -133,7 +133,10 @@ def main():
|
|||
print usage_str
|
||||
return
|
||||
|
||||
common_config.init(['--config-file', '/etc/neutron/neutron.conf'])
|
||||
common_config.init(['--config-file',
|
||||
'/etc/neutron/plugins/dragonflow.ini',
|
||||
'--config-file',
|
||||
'/etc/neutron/neutron.conf'])
|
||||
db_driver = df_utils.load_driver(
|
||||
cfg.CONF.df.nb_db_class,
|
||||
df_utils.DF_NB_DB_DRIVER_NAMESPACE)
|
||||
|
|
|
@ -70,8 +70,9 @@ def environment_destroy():
|
|||
|
||||
def main():
|
||||
cfg.CONF.register_opts(metadata_conf.METADATA_PROXY_HANDLER_OPTS)
|
||||
cfg.CONF.register_opts(common_params.df_opts, 'df')
|
||||
cfg.CONF.register_opts(metadata_service_app.options, 'df_metadata')
|
||||
cfg.CONF.register_opts(common_params.DF_OPTS, 'df')
|
||||
cfg.CONF.register_opts(metadata_service_app.DF_METADATA_OPTS,
|
||||
'df_metadata')
|
||||
config.init(sys.argv[1:])
|
||||
config.setup_logging()
|
||||
environment_setup()
|
||||
|
|
|
@ -15,7 +15,7 @@ from oslo_config import cfg
|
|||
from dragonflow._i18n import _
|
||||
from neutron.extensions import portbindings
|
||||
|
||||
df_opts = [
|
||||
DF_OPTS = [
|
||||
cfg.IPOpt('remote_db_ip',
|
||||
default='127.0.0.1',
|
||||
help=_('The remote db server ip address')),
|
||||
|
|
|
@ -36,7 +36,7 @@ from dragonflow.db import db_store
|
|||
from dragonflow.db.drivers import ovsdb_vswitch_impl
|
||||
|
||||
|
||||
df_ryu_opts = [
|
||||
DF_RYU_OPTS = [
|
||||
cfg.IPOpt('of_listen_address', default='127.0.0.1',
|
||||
help=_("Address to listen on for OpenFlow connections.")),
|
||||
cfg.PortOpt('of_listen_port', default=ofproto_common.OFP_TCP_PORT,
|
||||
|
@ -46,8 +46,8 @@ df_ryu_opts = [
|
|||
config.setup_logging()
|
||||
LOG = log.getLogger("dragonflow.controller.df_local_controller")
|
||||
|
||||
cfg.CONF.register_opts(common_params.df_opts, 'df')
|
||||
cfg.CONF.register_opts(df_ryu_opts, 'df_ryu')
|
||||
cfg.CONF.register_opts(common_params.DF_OPTS, 'df')
|
||||
cfg.CONF.register_opts(DF_RYU_OPTS, 'df_ryu')
|
||||
|
||||
|
||||
class DfLocalController(object):
|
||||
|
|
|
@ -163,7 +163,7 @@ class PublisherService(object):
|
|||
|
||||
|
||||
def main():
|
||||
cfg.CONF.register_opts(common_params.df_opts, 'df')
|
||||
cfg.CONF.register_opts(common_params.DF_OPTS, 'df')
|
||||
common_config.init(sys.argv[1:])
|
||||
config.setup_logging()
|
||||
service = PublisherService()
|
||||
|
|
|
@ -50,7 +50,7 @@ TCP_SYN = 0x002
|
|||
TCP_ACK = 0x010
|
||||
|
||||
|
||||
options = [
|
||||
DF_METADATA_OPTS = [
|
||||
cfg.IPOpt(
|
||||
'ip',
|
||||
default='169.254.169.254',
|
||||
|
@ -75,7 +75,7 @@ class MetadataServiceApp(df_base_app.DFlowApp):
|
|||
self._arp_responder = None
|
||||
self._ofport = None
|
||||
self._interface_mac = ""
|
||||
cfg.CONF.register_opts(options, group='df_metadata')
|
||||
cfg.CONF.register_opts(DF_METADATA_OPTS, group='df_metadata')
|
||||
self._ip = cfg.CONF.df_metadata.ip
|
||||
self._port = cfg.CONF.df_metadata.port
|
||||
self._interface = cfg.CONF.df.metadata_interface
|
||||
|
|
|
@ -25,7 +25,7 @@ from dragonflow.db import pub_sub_api
|
|||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
cfg.CONF.register_opts(common_params.df_opts, 'df')
|
||||
cfg.CONF.register_opts(common_params.DF_OPTS, 'df')
|
||||
|
||||
|
||||
class RedisPubSub(pub_sub_api.PubSubApi):
|
||||
|
|
|
@ -36,7 +36,7 @@ from dragonflow.db.neutron import versionobjects_db as version_db
|
|||
from dragonflow.neutron.common import constants as df_const
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
cfg.CONF.register_opts(common_params.df_opts, 'df')
|
||||
cfg.CONF.register_opts(common_params.DF_OPTS, 'df')
|
||||
|
||||
|
||||
class DFMechDriver(driver_api.MechanismDriver):
|
||||
|
|
|
@ -70,7 +70,7 @@ from dragonflow.neutron.common import constants as df_const
|
|||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
cfg.CONF.register_opts(common_params.df_opts, 'df')
|
||||
cfg.CONF.register_opts(common_params.DF_OPTS, 'df')
|
||||
|
||||
router_distributed_opts = [
|
||||
cfg.BoolOpt('router_distributed',
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
# 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
|
||||
|
||||
from dragonflow.common import common_params
|
||||
from dragonflow.controller import df_local_controller
|
||||
from dragonflow.controller import dhcp_app
|
||||
from dragonflow.controller import dnat_app
|
||||
from dragonflow.controller import l2_ml2_app
|
||||
from dragonflow.controller import metadata_service_app
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
def list_opts():
|
||||
return [
|
||||
('df', common_params.DF_OPTS),
|
||||
('df_ryu', df_local_controller.DF_RYU_OPTS),
|
||||
('df_dhcp_app', dhcp_app.DF_DHCP_OPTS),
|
||||
('df_dnat_app', dnat_app.DF_DNAT_APP_OPTS),
|
||||
('df_l2_app', l2_ml2_app.DF_L2_APP_OPTS),
|
||||
('df_metadata', metadata_service_app.DF_METADATA_OPTS)]
|
|
@ -32,7 +32,7 @@ from dragonflow.tests.common import utils as test_utils
|
|||
from dragonflow.tests.fullstack import test_objects as objects
|
||||
|
||||
|
||||
cfg.CONF.register_opts(common_params.df_opts, 'df')
|
||||
cfg.CONF.register_opts(common_params.DF_OPTS, 'df')
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ def run_client(nb_api):
|
|||
|
||||
def main():
|
||||
cfg.CONF.register_opts(df_db_test_opts, 'df_db_test')
|
||||
cfg.CONF.register_opts(common_params.df_opts, 'df')
|
||||
cfg.CONF.register_opts(common_params.DF_OPTS, 'df')
|
||||
common_config.init(sys.argv[2:])
|
||||
# To enable logging, uncomment the following line:
|
||||
#common_config.setup_logging()
|
||||
|
|
|
@ -23,7 +23,7 @@ from dragonflow.tests import base
|
|||
from dragonflow.tests.common import app_testing_objects as test_objects
|
||||
|
||||
|
||||
cfg.CONF.register_opts(common_params.df_opts, 'df')
|
||||
cfg.CONF.register_opts(common_params.DF_OPTS, 'df')
|
||||
|
||||
|
||||
def get_cloud_config(cloud='devstack-admin'):
|
||||
|
@ -52,7 +52,10 @@ class DFTestBase(base.BaseTestCase):
|
|||
if not self.get_default_subnetpool():
|
||||
self.create_default_subnetpool()
|
||||
|
||||
common_config.init(['--config-file', '/etc/neutron/neutron.conf'])
|
||||
common_config.init(['--config-file',
|
||||
'/etc/neutron/plugins/dragonflow.ini',
|
||||
'--config-file',
|
||||
'/etc/neutron/neutron.conf'])
|
||||
self.conf = cfg.CONF.df
|
||||
self.integration_bridge = self.conf.integration_bridge
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class TestMetadataService(test_base.DFTestBase):
|
|||
|
||||
def setUp(self):
|
||||
super(TestMetadataService, self).setUp()
|
||||
cfg.CONF.register_opts(metadata_service_app.options,
|
||||
cfg.CONF.register_opts(metadata_service_app.DF_METADATA_OPTS,
|
||||
group='df_metadata')
|
||||
# Override defaults to avoid collision with existing metadata service
|
||||
cfg.CONF.df_metadata.ip = '1.1.1.1'
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[DEFAULT]
|
||||
output_file = etc/dragonflow.ini.sample
|
||||
wrap_width = 79
|
||||
namespace = dragonflow
|
|
@ -68,3 +68,5 @@ dragonflow.nb_db_driver =
|
|||
redis_nb_db_driver = dragonflow.db.drivers.redis_db_driver:RedisDbDriver
|
||||
neutron.service_plugins =
|
||||
df-l3 = dragonflow.neutron.services.l3_router_plugin:DFL3RouterPlugin
|
||||
oslo.config.opts =
|
||||
dragonflow = dragonflow.opts:list_opts
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# 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.
|
||||
|
||||
set -e
|
||||
|
||||
GEN_CMD=oslo-config-generator
|
||||
|
||||
if ! type "$GEN_CMD" > /dev/null; then
|
||||
echo "ERROR: $GEN_CMD not installed on the system."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for file in `ls etc/oslo-config-generator/*`; do
|
||||
$GEN_CMD --config-file=$file
|
||||
done
|
||||
|
||||
set -x
|
Loading…
Reference in New Issue