devstack/lib/neutron_plugins/midonet
Dean Troyer e3a9160c0d Fix Neutron plugin XTRACE handling
The various Neutron plugin files need to have unique variables for the
xtrace state as they are sometimes nested more than two levels deep
and MY_XTRACE is getting stomped.  This gives each of the neutron_plugin
and neutron_thirdparty include files a unique XTRACE state variable.

I don't think this is a problem with any of the other plugin include
files (yet) so this just handles Neutron for now.

Change-Id: I7c272a48e7974edecaff5f431ff7443dd6622588
2014-03-28 12:40:59 -05:00

88 lines
2.4 KiB
Plaintext

# Neutron MidoNet plugin
# ----------------------
MIDONET_DIR=${MIDONET_DIR:-$DEST/midonet}
MIDONET_API_PORT=${MIDONET_API_PORT:-8080}
MIDONET_API_URL=${MIDONET_API_URL:-http://localhost:$MIDONET_API_PORT/midonet-api}
# Save trace setting
MN_XTRACE=$(set +o | grep xtrace)
set +o xtrace
function is_neutron_ovs_base_plugin {
# MidoNet does not use l3-agent
# 0 means True here
return 1
}
function neutron_plugin_create_nova_conf {
NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
}
function neutron_plugin_install_agent_packages {
:
}
function neutron_plugin_configure_common {
Q_PLUGIN_CONF_PATH=etc/neutron/plugins/midonet
Q_PLUGIN_CONF_FILENAME=midonet.ini
Q_DB_NAME="neutron_midonet"
Q_PLUGIN_CLASS="neutron.plugins.midonet.plugin.MidonetPluginV2"
}
function neutron_plugin_configure_debug_command {
:
}
function neutron_plugin_configure_dhcp_agent {
DHCP_DRIVER=${DHCP_DRIVER:-"neutron.plugins.midonet.agent.midonet_driver.DhcpNoOpDriver"}
neutron_plugin_setup_interface_driver $Q_DHCP_CONF_FILE
iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_driver $DHCP_DRIVER
iniset $Q_DHCP_CONF_FILE DEFAULT use_namespaces True
iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True
}
function neutron_plugin_configure_l3_agent {
die $LINENO "q-l3 must not be executed with MidoNet plugin!"
}
function neutron_plugin_configure_plugin_agent {
die $LINENO "q-agt must not be executed with MidoNet plugin!"
}
function neutron_plugin_configure_service {
if [[ "$MIDONET_API_URL" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE MIDONET midonet_uri $MIDONET_API_URL
fi
if [[ "$MIDONET_USERNAME" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE MIDONET username $MIDONET_USERNAME
fi
if [[ "$MIDONET_PASSWORD" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE MIDONET password $MIDONET_PASSWORD
fi
if [[ "$MIDONET_PROJECT_ID" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE MIDONET project_id $MIDONET_PROJECT_ID
fi
Q_L3_ENABLED=True
Q_L3_ROUTER_PER_TENANT=True
}
function neutron_plugin_setup_interface_driver {
local conf_file=$1
iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.MidonetInterfaceDriver
}
function has_neutron_plugin_security_group {
# 0 means True here
return 0
}
function neutron_plugin_check_adv_test_requirements {
# 0 means True here
return 1
}
# Restore xtrace
$MN_XTRACE