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
diff --git a/lib/quantum b/lib/quantum
index efdd43d..b088202 100644
--- a/lib/quantum
+++ b/lib/quantum
@@ -179,7 +179,7 @@
 # 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 87e7aaa..b6528b0 100644
--- a/lib/quantum_plugins/agent_loadbalancer
+++ b/lib/quantum_plugins/services/agent_loadbalancer
@@ -7,6 +7,7 @@
 
 
 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_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 @@
 
     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"