Browse code

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

Ryu Ishimoto authored on 2013/08/27 18:32:00
Showing 2 changed files
... ...
@@ -31,7 +31,12 @@ function neutron_plugin_configure_debug_command() {
31 31
 }
32 32
 
33 33
 function neutron_plugin_configure_dhcp_agent() {
34
-   die $LINENO "q-dhcp must not be executed with MidoNet plugin!"
34
+    DHCP_DRIVER=${DHCP_DRIVER:-"neutron.plugins.midonet.agent.midonet_driver.DhcpNoOpDriver"}
35
+    DHCP_INTERFACE_DRIVER=${DHCP_INTEFACE_DRIVER:-"neutron.plugins.midonet.agent.midonet_driver.MidonetInterfaceDriver"}
36
+    iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_driver $DHCP_DRIVER
37
+    iniset $Q_DHCP_CONF_FILE DEFAULT interface_driver $DHCP_INTERFACE_DRIVER
38
+    iniset $Q_DHCP_CONF_FILE DEFAULT use_namespaces True
39
+    iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True
35 40
 }
36 41
 
37 42
 function neutron_plugin_configure_l3_agent() {
... ...
@@ -58,9 +63,6 @@ function neutron_plugin_configure_service() {
58 58
     if [[ "$MIDONET_PROVIDER_ROUTER_ID" != "" ]]; then
59 59
         iniset /$Q_PLUGIN_CONF_FILE MIDONET provider_router_id $MIDONET_PROVIDER_ROUTER_ID
60 60
     fi
61
-    if [[ "$MIDONET_METADATA_ROUTER_ID" != "" ]]; then
62
-        iniset /$Q_PLUGIN_CONF_FILE MIDONET metadata_router_id $MIDONET_METADATA_ROUTER_ID
63
-    fi
64 61
 }
65 62
 
66 63
 function neutron_plugin_setup_interface_driver() {
... ...
@@ -10,22 +10,20 @@
10 10
 
11 11
 # MidoNet devstack destination dir
12 12
 MIDONET_DIR=${MIDONET_DIR:-$DEST/midonet}
13
+MIDONET_API_PORT=${MIDONET_API_PORT:-8080}
14
+MIDONET_API_URL=${MIDONET_API_URL:-http://localhost:$MIDONET_API_PORT/midonet-api}
13 15
 
14 16
 # MidoNet client repo
15 17
 MIDONET_CLIENT_REPO=${MIDONET_CLIENT_REPO:-https://github.com/midokura/python-midonetclient.git}
16 18
 MIDONET_CLIENT_BRANCH=${MIDONET_CLIENT_BRANCH:-master}
17
-MIDONET_CLIENT_DIR=$MIDONET_DIR/python-midonetclient
19
+MIDONET_CLIENT_DIR=${MIDONET_CLIENT_DIR:-$MIDONET_DIR/python-midonetclient}
18 20
 
19 21
 # MidoNet OpenStack repo
20 22
 MIDONET_OS_REPO=${MIDONET_OS_REPO:-https://github.com/midokura/midonet-openstack.git}
21 23
 MIDONET_OS_BRANCH=${MIDONET_OS_BRANCH:-master}
22
-MIDONET_OS_DIR=$MIDONET_DIR/midonet-openstack
24
+MIDONET_OS_DIR=${MIDONET_OS_DIR:-$MIDONET_DIR/midonet-openstack}
23 25
 MIDONET_SETUP_SCRIPT=${MIDONET_SETUP_SCRIPT:-$MIDONET_OS_DIR/bin/setup_midonet_topology.py}
24 26
 
25
-
26
-MIDOLMAN_LOG=${MIDOLMAN_LOG:-/var/log/midolman/midolman.log}
27
-MIDONET_API_LOG=${MIDONET_API_LOG:-/var/log/tomcat7/midonet-api.log}
28
-
29 27
 # Save trace setting
30 28
 MY_XTRACE=$(set +o | grep xtrace)
31 29
 set +o xtrace
... ...
@@ -37,13 +35,11 @@ function configure_midonet() {
37 37
 function init_midonet() {
38 38
 
39 39
     # Initialize DB.  Evaluate the output of setup_midonet_topology.py to set
40
-    # env variables for provider router ID and metadata router ID
41
-    eval `python $MIDONET_SETUP_SCRIPT admin $ADMIN_PASSWORD $ADMIN_TENANT provider_devices`
40
+    # env variables for provider router ID.
41
+    eval `python $MIDONET_SETUP_SCRIPT $MIDONET_API_URL admin $ADMIN_PASSWORD admin provider_devices`
42 42
     die_if_not_set $LINENO provider_router_id "Error running midonet setup script, provider_router_id was not set."
43
-    die_if_not_set $LINENO metadata_router_id "Error running midonet setup script, metadata_router_id was not set."
44 43
 
45 44
     iniset /$Q_PLUGIN_CONF_FILE MIDONET provider_router_id $provider_router_id
46
-    iniset /$Q_PLUGIN_CONF_FILE MIDONET metadata_router_id $metadata_router_id
47 45
 }
48 46
 
49 47
 function install_midonet() {