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} |
| 13 | |
| 14 | # MidoNet client repo |
| 15 | MIDONET_CLIENT_REPO=${MIDONET_CLIENT_REPO:-https://github.com/midokura/python-midonetclient.git} |
| 16 | MIDONET_CLIENT_BRANCH=${MIDONET_CLIENT_BRANCH:-master} |
| 17 | MIDONET_CLIENT_DIR=$MIDONET_DIR/python-midonetclient |
| 18 | |
| 19 | # MidoNet OpenStack repo |
| 20 | MIDONET_OS_REPO=${MIDONET_OS_REPO:-https://github.com/midokura/midonet-openstack.git} |
| 21 | MIDONET_OS_BRANCH=${MIDONET_OS_BRANCH:-master} |
| 22 | MIDONET_OS_DIR=$MIDONET_DIR/midonet-openstack |
| 23 | MIDONET_SETUP_SCRIPT=${MIDONET_SETUP_SCRIPT:-$MIDONET_OS_DIR/bin/setup_midonet_topology.py} |
| 24 | |
| 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 | # Save trace setting |
| 30 | MY_XTRACE=$(set +o | grep xtrace) |
| 31 | set +o xtrace |
| 32 | |
| 33 | function configure_midonet() { |
| 34 | : |
| 35 | } |
| 36 | |
| 37 | function init_midonet() { |
| 38 | |
| 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` |
| 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 | |
| 45 | 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 | } |
| 48 | |
| 49 | function install_midonet() { |
| 50 | git_clone $MIDONET_CLIENT_REPO $MIDONET_CLIENT_DIR $MIDONET_CLIENT_BRANCH |
| 51 | git_clone $MIDONET_OS_REPO $MIDONET_OS_DIR $MIDONET_OS_BRANCH |
| 52 | export PYTHONPATH=$MIDONET_CLIENT_DIR/src:$MIDONET_OS_DIR/src:$PYTHONPATH |
| 53 | } |
| 54 | |
| 55 | function start_midonet() { |
| 56 | : |
| 57 | } |
| 58 | |
| 59 | function stop_midonet() { |
| 60 | : |
| 61 | } |
| 62 | |
| 63 | # Restore xtrace |
| 64 | $MY_XTRACE |