From c07112a203aa9a25d2abaf497a740abd908e5919 Mon Sep 17 00:00:00 2001 From: Akihiro MOTOKI Date: Fri, 22 Mar 2013 16:35:38 +0900 Subject: [PATCH] Allow a plugin specific interface_driver config in q-lbaas Previously interface_driver for q-lbaas is hardcoded and q-lbaas does not work when quantum plugin requires additional configuration (like ovs_use_veth=True). This commit set up interface_driver using quantum_plugin_setup_interface_driver function. This commit also moves a script related Quantum service plugin to lib/quantum_plugins/services/ Change-Id: Iad11c1b31071dfb580843be18be78c83feb91f10 --- lib/quantum | 2 +- .../{ => services}/agent_loadbalancer | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) rename lib/quantum_plugins/{ => services}/agent_loadbalancer (60%) diff --git a/lib/quantum b/lib/quantum index efdd43d071..b088202f73 100644 --- a/lib/quantum +++ b/lib/quantum @@ -179,7 +179,7 @@ source $TOP_DIR/lib/quantum_plugins/$Q_PLUGIN # Agent loadbalancer service plugin functions # ------------------------------------------- # Hardcoding for 1 service plugin for now -source $TOP_DIR/lib/quantum_plugins/agent_loadbalancer +source $TOP_DIR/lib/quantum_plugins/services/agent_loadbalancer # Use security group or not if has_quantum_plugin_security_group; then diff --git a/lib/quantum_plugins/agent_loadbalancer b/lib/quantum_plugins/services/agent_loadbalancer similarity index 60% rename from lib/quantum_plugins/agent_loadbalancer rename to lib/quantum_plugins/services/agent_loadbalancer index 87e7aaaf36..b6528b0e84 100644 --- a/lib/quantum_plugins/agent_loadbalancer +++ b/lib/quantum_plugins/services/agent_loadbalancer @@ -7,6 +7,7 @@ set +o xtrace AGENT_LBAAS_BINARY="$QUANTUM_DIR/bin/quantum-lbaas-agent" +AGENT_LBAAS_PLUGIN=quantum.plugins.services.agent_loadbalancer.plugin.LoadBalancerPlugin function quantum_agent_lbaas_install_agent_packages() { if is_ubuntu || is_fedora; then @@ -19,9 +20,9 @@ function quantum_agent_lbaas_install_agent_packages() { function quantum_agent_lbaas_configure_common() { if [[ $Q_SERVICE_PLUGIN_CLASSES == '' ]]; then - Q_SERVICE_PLUGIN_CLASSES="quantum.plugins.services.agent_loadbalancer.plugin.LoadBalancerPlugin" + Q_SERVICE_PLUGIN_CLASSES=$AGENT_LBAAS_PLUGIN else - Q_SERVICE_PLUGIN_CLASSES="$Q_SERVICE_PLUGIN_CLASSES,quantum.plugins.services.agent_loadbalancer.plugin.LoadBalancerPlugin" + Q_SERVICE_PLUGIN_CLASSES="$Q_SERVICE_PLUGIN_CLASSES,$AGENT_LBAAS_PLUGIN" fi } @@ -31,13 +32,9 @@ function quantum_agent_lbaas_configure_agent() { LBAAS_AGENT_CONF_FILENAME="$LBAAS_AGENT_CONF_PATH/lbaas_agent.ini" - cp $QUANTUM_DIR/etc/lbaas_agent.ini /$LBAAS_AGENT_CONF_FILENAME + cp $QUANTUM_DIR/etc/lbaas_agent.ini $LBAAS_AGENT_CONF_FILENAME - if [[ $Q_PLUGIN == 'linuxbridge' || $Q_PLUGIN == 'brocade' ]]; then - iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT interface_driver "quantum.agent.linux.interface.BridgeInterfaceDriver" - else - iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT interface_driver "quantum.agent.linux.interface.OVSInterfaceDriver" - fi + quantum_plugin_setup_interface_driver $LBAAS_AGENT_CONF_FILENAME if is_fedora; then iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT user_group "nobody"