From 061d52507d4f4e597b825e7e7fb0d9d1858e08db Mon Sep 17 00:00:00 2001
From: Kyle Mestery <kmestery@cisco.com>
Date: Mon, 9 Sep 2013 08:52:19 +0000
Subject: [PATCH] Augment instead of override extra ML2 options.

The existing ML2 code overwrote extra options set in localrc with
defualt values in some cases. This fixes it so it no longer does
that and instead adds to rather than overrides those values.

Fixes bug 1222854

Change-Id: Iafdaad7d4253f1b61e8a214c50adaf7599a641f2
---
 lib/neutron_plugins/ml2 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/neutron_plugins/ml2 b/lib/neutron_plugins/ml2
index 00bd716309..4d4340b614 100644
--- a/lib/neutron_plugins/ml2
+++ b/lib/neutron_plugins/ml2
@@ -10,9 +10,9 @@ set +o xtrace
 Q_ML2_TENANT_NETWORK_TYPE=${Q_ML2_TENANT_NETWORK_TYPE:-}
 # This has to be set here since the agent will set this in the config file
 if [[ "$Q_ML2_TENANT_NETWORK_TYPE" != "" ]]; then
-    Q_AGENT_EXTRA_AGENT_OPTS=(tunnel_types=$Q_ML2_TENANT_NETWORK_TYPE)
+    Q_AGENT_EXTRA_AGENT_OPTS+=(tunnel_types=$Q_ML2_TENANT_NETWORK_TYPE)
 elif [[ "$ENABLE_TENANT_TUNNELS" = "True" ]]; then
-    Q_AGENT_EXTRA_AGENT_OPTS=(tunnel_types=gre)
+    Q_AGENT_EXTRA_AGENT_OPTS+=(tunnel_types=gre)
 fi
 
 # Default openvswitch L2 agent
@@ -50,14 +50,14 @@ function neutron_plugin_configure_common() {
 
 function neutron_plugin_configure_service() {
     if [[ "$Q_ML2_TENANT_NETWORK_TYPE" != "" ]]; then
-        Q_SRV_EXTRA_OPTS=(tenant_network_types=$Q_ML2_TENANT_NETWORK_TYPE)
+        Q_SRV_EXTRA_OPTS+=(tenant_network_types=$Q_ML2_TENANT_NETWORK_TYPE)
     elif [[ "$ENABLE_TENANT_TUNNELS" = "True" ]]; then
         # This assumes you want a simple configuration, and will overwrite
         # Q_SRV_EXTRA_OPTS if set in addition to ENABLE_TENANT_TUNNELS.
-        Q_SRV_EXTRA_OPTS=(tenant_network_types=gre)
+        Q_SRV_EXTRA_OPTS+=(tenant_network_types=gre)
         Q_ML2_PLUGIN_GRE_TYPE_OPTIONS=(tunnel_id_ranges=$TENANT_TUNNEL_RANGES)
     elif [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then
-        Q_SRV_EXTRA_OPTS=(tenant_network_types=vlan)
+        Q_SRV_EXTRA_OPTS+=(tenant_network_types=vlan)
     else
         echo "WARNING - The ml2 plugin is using local tenant networks, with no connectivity between hosts."
     fi