blob: 7855cd0eb1317e0071fc13464aa58e1648cf1b64 [file] [log] [blame]
Bob Kukurac9b0f1a2013-04-23 16:28:24 -04001# Quantum Linux Bridge L2 agent
2# -----------------------------
3
4# Save trace setting
5PLUGIN_XTRACE=$(set +o | grep xtrace)
6set +o xtrace
7
8function is_quantum_ovs_base_plugin() {
9 # linuxbridge doesn't use OVS
10 return 1
11}
12
13function quantum_plugin_create_nova_conf() {
14 NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
15}
16
17function quantum_plugin_install_agent_packages() {
18 install_package bridge-utils
19}
20
21function quantum_plugin_configure_debug_command() {
22 iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT external_network_bridge
23}
24
25function quantum_plugin_configure_dhcp_agent() {
26 iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager quantum.agent.dhcp_agent.DhcpAgentWithStateReport
27}
28
29function 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
34function 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 Mesteryebfac642013-05-17 15:20:56 -050050 # 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 Kukurac9b0f1a2013-04-23 16:28:24 -040064}
65
66function quantum_plugin_setup_interface_driver() {
67 local conf_file=$1
68 iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.BridgeInterfaceDriver
69}
70
71function 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