| 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" | 
 | 50 | } | 
 | 51 |  | 
 | 52 | function quantum_plugin_setup_interface_driver() { | 
 | 53 |     local conf_file=$1 | 
 | 54 |     iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.BridgeInterfaceDriver | 
 | 55 | } | 
 | 56 |  | 
 | 57 | function quantum_plugin_check_adv_test_requirements() { | 
 | 58 |     is_service_enabled q-agt && is_service_enabled q-dhcp && return 0 | 
 | 59 | } | 
 | 60 |  | 
 | 61 | # Restore xtrace | 
 | 62 | $PLUGIN_XTRACE |