From 35f0966d351c6cf4fe11c7bf482e1d9c02c7dac5 Mon Sep 17 00:00:00 2001 From: Ryu Ishimoto Date: Tue, 27 Aug 2013 18:32:00 +0900 Subject: [PATCH] Modify midonet plugin to support the latest MidoNet MidoNet has been upgraded and devstack needs to be updated to be compatible. This change is required to run the current version of MidoNet plugin with DevStack. Closes-Bug: #1222314 Change-Id: If3379b4d5da4e4fcf989ee7398b5952d71b68d5a --- lib/neutron_plugins/midonet | 10 ++++++---- lib/neutron_thirdparty/midonet | 16 ++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/neutron_plugins/midonet b/lib/neutron_plugins/midonet index 4d343f5c91..0ad760b289 100644 --- a/lib/neutron_plugins/midonet +++ b/lib/neutron_plugins/midonet @@ -31,7 +31,12 @@ function neutron_plugin_configure_debug_command() { } function neutron_plugin_configure_dhcp_agent() { - die $LINENO "q-dhcp must not be executed with MidoNet plugin!" + DHCP_DRIVER=${DHCP_DRIVER:-"neutron.plugins.midonet.agent.midonet_driver.DhcpNoOpDriver"} + DHCP_INTERFACE_DRIVER=${DHCP_INTEFACE_DRIVER:-"neutron.plugins.midonet.agent.midonet_driver.MidonetInterfaceDriver"} + iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_driver $DHCP_DRIVER + iniset $Q_DHCP_CONF_FILE DEFAULT interface_driver $DHCP_INTERFACE_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() { @@ -58,9 +63,6 @@ function neutron_plugin_configure_service() { if [[ "$MIDONET_PROVIDER_ROUTER_ID" != "" ]]; then iniset /$Q_PLUGIN_CONF_FILE MIDONET provider_router_id $MIDONET_PROVIDER_ROUTER_ID fi - if [[ "$MIDONET_METADATA_ROUTER_ID" != "" ]]; then - iniset /$Q_PLUGIN_CONF_FILE MIDONET metadata_router_id $MIDONET_METADATA_ROUTER_ID - fi } function neutron_plugin_setup_interface_driver() { diff --git a/lib/neutron_thirdparty/midonet b/lib/neutron_thirdparty/midonet index b3c726fe93..7928bca31f 100644 --- a/lib/neutron_thirdparty/midonet +++ b/lib/neutron_thirdparty/midonet @@ -10,22 +10,20 @@ # MidoNet devstack destination dir 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} # MidoNet client repo MIDONET_CLIENT_REPO=${MIDONET_CLIENT_REPO:-https://github.com/midokura/python-midonetclient.git} MIDONET_CLIENT_BRANCH=${MIDONET_CLIENT_BRANCH:-master} -MIDONET_CLIENT_DIR=$MIDONET_DIR/python-midonetclient +MIDONET_CLIENT_DIR=${MIDONET_CLIENT_DIR:-$MIDONET_DIR/python-midonetclient} # MidoNet OpenStack repo MIDONET_OS_REPO=${MIDONET_OS_REPO:-https://github.com/midokura/midonet-openstack.git} MIDONET_OS_BRANCH=${MIDONET_OS_BRANCH:-master} -MIDONET_OS_DIR=$MIDONET_DIR/midonet-openstack +MIDONET_OS_DIR=${MIDONET_OS_DIR:-$MIDONET_DIR/midonet-openstack} MIDONET_SETUP_SCRIPT=${MIDONET_SETUP_SCRIPT:-$MIDONET_OS_DIR/bin/setup_midonet_topology.py} - -MIDOLMAN_LOG=${MIDOLMAN_LOG:-/var/log/midolman/midolman.log} -MIDONET_API_LOG=${MIDONET_API_LOG:-/var/log/tomcat7/midonet-api.log} - # Save trace setting MY_XTRACE=$(set +o | grep xtrace) set +o xtrace @@ -37,13 +35,11 @@ function configure_midonet() { function init_midonet() { # Initialize DB. Evaluate the output of setup_midonet_topology.py to set - # env variables for provider router ID and metadata router ID - eval `python $MIDONET_SETUP_SCRIPT admin $ADMIN_PASSWORD $ADMIN_TENANT provider_devices` + # env variables for provider router ID. + eval `python $MIDONET_SETUP_SCRIPT $MIDONET_API_URL admin $ADMIN_PASSWORD admin provider_devices` die_if_not_set $LINENO provider_router_id "Error running midonet setup script, provider_router_id was not set." - die_if_not_set $LINENO metadata_router_id "Error running midonet setup script, metadata_router_id was not set." iniset /$Q_PLUGIN_CONF_FILE MIDONET provider_router_id $provider_router_id - iniset /$Q_PLUGIN_CONF_FILE MIDONET metadata_router_id $metadata_router_id } function install_midonet() {