Bob Kukura | c9b0f1a | 2013-04-23 16:28:24 -0400 | [diff] [blame] | 1 | # Quantum Linux Bridge L2 agent |
| 2 | # ----------------------------- |
| 3 | |
| 4 | # Save trace setting |
| 5 | PLUGIN_XTRACE=$(set +o | grep xtrace) |
| 6 | set +o xtrace |
| 7 | |
| 8 | function is_quantum_ovs_base_plugin() { |
| 9 | # linuxbridge doesn't use OVS |
| 10 | return 1 |
| 11 | } |
| 12 | |
| 13 | function quantum_plugin_create_nova_conf() { |
| 14 | NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"} |
| 15 | } |
| 16 | |
| 17 | function quantum_plugin_install_agent_packages() { |
| 18 | install_package bridge-utils |
| 19 | } |
| 20 | |
| 21 | function quantum_plugin_configure_debug_command() { |
| 22 | iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT external_network_bridge |
| 23 | } |
| 24 | |
| 25 | function quantum_plugin_configure_dhcp_agent() { |
| 26 | iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager quantum.agent.dhcp_agent.DhcpAgentWithStateReport |
| 27 | } |
| 28 | |
| 29 | function quantum_plugin_configure_l3_agent() { |
| 30 | iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge |
| 31 | iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager quantum.agent.l3_agent.L3NATAgentWithStateReport |
| 32 | } |
| 33 | |
| 34 | function quantum_plugin_configure_plugin_agent() { |
| 35 | # Setup physical network interface mappings. Override |
| 36 | # ``LB_VLAN_RANGES`` and ``LB_INTERFACE_MAPPINGS`` in ``localrc`` for more |
| 37 | # complex physical network configurations. |
| 38 | if [[ "$LB_INTERFACE_MAPPINGS" = "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]] && [[ "$LB_PHYSICAL_INTERFACE" != "" ]]; then |
| 39 | LB_INTERFACE_MAPPINGS=$PHYSICAL_NETWORK:$LB_PHYSICAL_INTERFACE |
| 40 | fi |
| 41 | if [[ "$LB_INTERFACE_MAPPINGS" != "" ]]; then |
| 42 | iniset /$Q_PLUGIN_CONF_FILE LINUX_BRIDGE physical_interface_mappings $LB_INTERFACE_MAPPINGS |
| 43 | fi |
| 44 | if [[ "$Q_USE_SECGROUP" == "True" ]]; then |
| 45 | iniset /$Q_PLUGIN_CONF_FILE SECURITYGROUP firewall_driver quantum.agent.linux.iptables_firewall.IptablesFirewallDriver |
| 46 | else |
| 47 | iniset /$Q_PLUGIN_CONF_FILE SECURITYGROUP firewall_driver quantum.agent.firewall.NoopFirewallDriver |
| 48 | fi |
| 49 | AGENT_BINARY="$QUANTUM_DIR/bin/quantum-linuxbridge-agent" |
Kyle Mestery | ebfac64 | 2013-05-17 15:20:56 -0500 | [diff] [blame^] | 50 | # Define extra "AGENT" configuration options when q-agt is configured by defining |
| 51 | # the array ``Q_AGENT_EXTRA_AGENT_OPTS``. |
| 52 | # For Example: ``Q_AGENT_EXTRA_AGENT_OPTS=(foo=true bar=2)`` |
| 53 | for I in "${Q_AGENT_EXTRA_AGENT_OPTS[@]}"; do |
| 54 | # Replace the first '=' with ' ' for iniset syntax |
| 55 | iniset /$Q_PLUGIN_CONF_FILE AGENT ${I/=/ } |
| 56 | done |
| 57 | # Define extra "LINUX_BRIDGE" configuration options when q-agt is configured by defining |
| 58 | # the array ``Q_AGENT_EXTRA_SRV_OPTS``. |
| 59 | # For Example: ``Q_AGENT_EXTRA_SRV_OPTS=(foo=true bar=2)`` |
| 60 | for I in "${Q_AGENT_EXTRA_SRV_OPTS[@]}"; do |
| 61 | # Replace the first '=' with ' ' for iniset syntax |
| 62 | iniset /$Q_PLUGIN_CONF_FILE LINUX_BRIDGE ${I/=/ } |
| 63 | done |
Bob Kukura | c9b0f1a | 2013-04-23 16:28:24 -0400 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | function quantum_plugin_setup_interface_driver() { |
| 67 | local conf_file=$1 |
| 68 | iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.BridgeInterfaceDriver |
| 69 | } |
| 70 | |
| 71 | function quantum_plugin_check_adv_test_requirements() { |
| 72 | is_service_enabled q-agt && is_service_enabled q-dhcp && return 0 |
| 73 | } |
| 74 | |
| 75 | # Restore xtrace |
| 76 | $PLUGIN_XTRACE |