av-mido | 2c3428b | 2013-07-11 14:59:00 +0900 | [diff] [blame] | 1 | # Neutron MidoNet plugin |
| 2 | # ---------------------- |
| 3 | |
| 4 | # Save trace setting |
| 5 | MY_XTRACE=$(set +o | grep xtrace) |
| 6 | set +o xtrace |
| 7 | |
| 8 | function is_neutron_ovs_base_plugin() { |
| 9 | # MidoNet does not use l3-agent |
| 10 | # 0 means True here |
| 11 | return 1 |
| 12 | } |
| 13 | |
| 14 | function neutron_plugin_create_nova_conf() { |
Joe Mills | a2fd222 | 2013-10-04 11:46:10 +0000 | [diff] [blame] | 15 | NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"} |
av-mido | 2c3428b | 2013-07-11 14:59:00 +0900 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | function neutron_plugin_install_agent_packages() { |
| 19 | : |
| 20 | } |
| 21 | |
| 22 | function neutron_plugin_configure_common() { |
| 23 | Q_PLUGIN_CONF_PATH=etc/neutron/plugins/midonet |
| 24 | Q_PLUGIN_CONF_FILENAME=midonet.ini |
| 25 | Q_DB_NAME="neutron_midonet" |
| 26 | Q_PLUGIN_CLASS="neutron.plugins.midonet.plugin.MidonetPluginV2" |
| 27 | } |
| 28 | |
| 29 | function neutron_plugin_configure_debug_command() { |
| 30 | : |
| 31 | } |
| 32 | |
| 33 | function neutron_plugin_configure_dhcp_agent() { |
Ryu Ishimoto | 35f0966 | 2013-08-27 18:32:00 +0900 | [diff] [blame] | 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 |
Joe Mills | 87acc91 | 2013-10-01 08:13:06 +0000 | [diff] [blame] | 40 | if [[ "$MIDONET_API_URI" != "" ]]; then |
| 41 | iniset $Q_DHCP_CONF_FILE MIDONET midonet_uri "$MIDONET_API_URI" |
| 42 | fi |
| 43 | if [[ "$MIDONET_USERNAME" != "" ]]; then |
| 44 | iniset $Q_DHCP_CONF_FILE MIDONET username "$MIDONET_USERNAME" |
| 45 | fi |
| 46 | if [[ "$MIDONET_PASSWORD" != "" ]]; then |
| 47 | iniset $Q_DHCP_CONF_FILE MIDONET password "$MIDONET_PASSWORD" |
| 48 | fi |
| 49 | if [[ "$MIDONET_PROJECT_ID" != "" ]]; then |
| 50 | iniset $Q_DHCP_CONF_FILE MIDONET project_id "$MIDONET_PROJECT_ID" |
| 51 | fi |
av-mido | 2c3428b | 2013-07-11 14:59:00 +0900 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | function neutron_plugin_configure_l3_agent() { |
Sean Dague | 3bdb922 | 2013-10-22 08:36:16 -0400 | [diff] [blame] | 55 | die $LINENO "q-l3 must not be executed with MidoNet plugin!" |
av-mido | 2c3428b | 2013-07-11 14:59:00 +0900 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | function neutron_plugin_configure_plugin_agent() { |
Sean Dague | 3bdb922 | 2013-10-22 08:36:16 -0400 | [diff] [blame] | 59 | die $LINENO "q-agt must not be executed with MidoNet plugin!" |
av-mido | 2c3428b | 2013-07-11 14:59:00 +0900 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | function neutron_plugin_configure_service() { |
| 63 | if [[ "$MIDONET_API_URI" != "" ]]; then |
| 64 | iniset /$Q_PLUGIN_CONF_FILE MIDONET midonet_uri $MIDONET_API_URI |
| 65 | fi |
| 66 | if [[ "$MIDONET_USERNAME" != "" ]]; then |
| 67 | iniset /$Q_PLUGIN_CONF_FILE MIDONET username $MIDONET_USERNAME |
| 68 | fi |
| 69 | if [[ "$MIDONET_PASSWORD" != "" ]]; then |
| 70 | iniset /$Q_PLUGIN_CONF_FILE MIDONET password $MIDONET_PASSWORD |
| 71 | fi |
| 72 | if [[ "$MIDONET_PROJECT_ID" != "" ]]; then |
| 73 | iniset /$Q_PLUGIN_CONF_FILE MIDONET project_id $MIDONET_PROJECT_ID |
| 74 | fi |
| 75 | if [[ "$MIDONET_PROVIDER_ROUTER_ID" != "" ]]; then |
| 76 | iniset /$Q_PLUGIN_CONF_FILE MIDONET provider_router_id $MIDONET_PROVIDER_ROUTER_ID |
| 77 | fi |
av-mido | 2c3428b | 2013-07-11 14:59:00 +0900 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | function neutron_plugin_setup_interface_driver() { |
| 81 | # May change in the future |
| 82 | : |
| 83 | } |
| 84 | |
| 85 | function has_neutron_plugin_security_group() { |
| 86 | # 0 means True here |
| 87 | return 0 |
| 88 | } |
| 89 | |
| 90 | function neutron_plugin_check_adv_test_requirements() { |
| 91 | # 0 means True here |
| 92 | return 1 |
| 93 | } |
| 94 | |
| 95 | # Restore xtrace |
| 96 | $MY_XTRACE |