| av-mido | 2c3428b | 2013-07-11 14:59:00 +0900 | [diff] [blame] | 1 | # MidoNet | 
|  | 2 | # ------- | 
|  | 3 |  | 
|  | 4 | # This file implements functions required to configure MidoNet as the third-party | 
|  | 5 | # system used with devstack's Neutron.  To include this file, specify the following | 
|  | 6 | # variables in localrc: | 
|  | 7 | # | 
|  | 8 | # * enable_service midonet | 
|  | 9 | # | 
|  | 10 |  | 
|  | 11 | # MidoNet devstack destination dir | 
|  | 12 | MIDONET_DIR=${MIDONET_DIR:-$DEST/midonet} | 
| Ryu Ishimoto | 35f0966 | 2013-08-27 18:32:00 +0900 | [diff] [blame] | 13 | MIDONET_API_PORT=${MIDONET_API_PORT:-8080} | 
|  | 14 | MIDONET_API_URL=${MIDONET_API_URL:-http://localhost:$MIDONET_API_PORT/midonet-api} | 
| av-mido | 2c3428b | 2013-07-11 14:59:00 +0900 | [diff] [blame] | 15 |  | 
|  | 16 | # MidoNet client repo | 
|  | 17 | MIDONET_CLIENT_REPO=${MIDONET_CLIENT_REPO:-https://github.com/midokura/python-midonetclient.git} | 
|  | 18 | MIDONET_CLIENT_BRANCH=${MIDONET_CLIENT_BRANCH:-master} | 
| Ryu Ishimoto | 35f0966 | 2013-08-27 18:32:00 +0900 | [diff] [blame] | 19 | MIDONET_CLIENT_DIR=${MIDONET_CLIENT_DIR:-$MIDONET_DIR/python-midonetclient} | 
| av-mido | 2c3428b | 2013-07-11 14:59:00 +0900 | [diff] [blame] | 20 |  | 
|  | 21 | # MidoNet OpenStack repo | 
|  | 22 | MIDONET_OS_REPO=${MIDONET_OS_REPO:-https://github.com/midokura/midonet-openstack.git} | 
|  | 23 | MIDONET_OS_BRANCH=${MIDONET_OS_BRANCH:-master} | 
| Ryu Ishimoto | 35f0966 | 2013-08-27 18:32:00 +0900 | [diff] [blame] | 24 | MIDONET_OS_DIR=${MIDONET_OS_DIR:-$MIDONET_DIR/midonet-openstack} | 
| av-mido | 2c3428b | 2013-07-11 14:59:00 +0900 | [diff] [blame] | 25 | MIDONET_SETUP_SCRIPT=${MIDONET_SETUP_SCRIPT:-$MIDONET_OS_DIR/bin/setup_midonet_topology.py} | 
|  | 26 |  | 
| av-mido | 2c3428b | 2013-07-11 14:59:00 +0900 | [diff] [blame] | 27 | # Save trace setting | 
|  | 28 | MY_XTRACE=$(set +o | grep xtrace) | 
|  | 29 | set +o xtrace | 
|  | 30 |  | 
|  | 31 | function configure_midonet() { | 
|  | 32 | : | 
|  | 33 | } | 
|  | 34 |  | 
|  | 35 | function init_midonet() { | 
|  | 36 |  | 
|  | 37 | # Initialize DB.  Evaluate the output of setup_midonet_topology.py to set | 
| Ryu Ishimoto | 35f0966 | 2013-08-27 18:32:00 +0900 | [diff] [blame] | 38 | # env variables for provider router ID. | 
|  | 39 | eval `python $MIDONET_SETUP_SCRIPT $MIDONET_API_URL admin $ADMIN_PASSWORD admin provider_devices` | 
| av-mido | 2c3428b | 2013-07-11 14:59:00 +0900 | [diff] [blame] | 40 | die_if_not_set $LINENO provider_router_id "Error running midonet setup script, provider_router_id was not set." | 
| av-mido | 2c3428b | 2013-07-11 14:59:00 +0900 | [diff] [blame] | 41 |  | 
|  | 42 | iniset /$Q_PLUGIN_CONF_FILE MIDONET provider_router_id $provider_router_id | 
| av-mido | 2c3428b | 2013-07-11 14:59:00 +0900 | [diff] [blame] | 43 | } | 
|  | 44 |  | 
|  | 45 | function install_midonet() { | 
|  | 46 | git_clone $MIDONET_CLIENT_REPO $MIDONET_CLIENT_DIR $MIDONET_CLIENT_BRANCH | 
|  | 47 | git_clone $MIDONET_OS_REPO $MIDONET_OS_DIR $MIDONET_OS_BRANCH | 
|  | 48 | export PYTHONPATH=$MIDONET_CLIENT_DIR/src:$MIDONET_OS_DIR/src:$PYTHONPATH | 
|  | 49 | } | 
|  | 50 |  | 
|  | 51 | function start_midonet() { | 
|  | 52 | : | 
|  | 53 | } | 
|  | 54 |  | 
|  | 55 | function stop_midonet() { | 
|  | 56 | : | 
|  | 57 | } | 
|  | 58 |  | 
| armando-migliaccio | ef1e080 | 2014-01-02 16:33:53 -0800 | [diff] [blame] | 59 | function check_midonet() { | 
|  | 60 | : | 
|  | 61 | } | 
|  | 62 |  | 
| av-mido | 2c3428b | 2013-07-11 14:59:00 +0900 | [diff] [blame] | 63 | # Restore xtrace | 
|  | 64 | $MY_XTRACE |