Browse code

Correctly set the L3 service plugin for ML2

ML2 uses a service plugin for L3. This patch to devstack
correctly sets this by setting or updating the variable
Q_SERVICE_PLUGIN_CLASSES, which makes ML2 compatible when
running with other service plugins (e.g. LBaaS and VPN).

Fixes bug 1231622

Change-Id: I0ce1f5a42bd052995135ffac1ee5ef382d69789e

Kyle Mestery authored on 2013/09/22 12:04:56
Showing 1 changed files
... ...
@@ -30,6 +30,9 @@ Q_ML2_PLUGIN_VXLAN_TYPE_OPTIONS=${Q_ML2_PLUGIN_VXLAN_TYPE_OPTIONS:-vni_ranges=10
30 30
 # Default VLAN TypeDriver options
31 31
 Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS=${Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS:-}
32 32
 
33
+# L3 Plugin to load for ML2
34
+ML2_L3_PLUGIN=${ML2_L3_PLUGIN:-neutron.services.l3_router.l3_router_plugin.L3RouterPlugin}
35
+
33 36
 function populate_ml2_config() {
34 37
     OPTS=$1
35 38
     CONF=$2
... ...
@@ -48,13 +51,11 @@ function neutron_plugin_configure_common() {
48 48
     Q_PLUGIN_CLASS="neutron.plugins.ml2.plugin.Ml2Plugin"
49 49
     # The ML2 plugin delegates L3 routing/NAT functionality to
50 50
     # the L3 service plugin which must therefore be specified.
51
-    Q_L3_PLUGIN_CLASS=${Q_L3_PLUGIN_CLASS:-"neutron.services.l3_router.l3_router_plugin.L3RouterPlugin"}
52
-    if  ini_has_option $NEUTRON_CONF DEFAULT service_plugins ; then
53
-        srv_plugins=$(iniget $NEUTRON_CONF DEFAULT service_plugins)","$Q_L3_PLUGIN_CLASS
51
+    if [[ $Q_SERVICE_PLUGIN_CLASSES == '' ]]; then
52
+        Q_SERVICE_PLUGIN_CLASSES=$ML2_L3_PLUGIN
54 53
     else
55
-        srv_plugins=$Q_L3_PLUGIN_CLASS
54
+        Q_SERVICE_PLUGIN_CLASSES="$Q_SERVICE_PLUGIN_CLASSES,$ML2_L3_PLUGIN"
56 55
     fi
57
-    iniset $NEUTRON_CONF DEFAULT service_plugins $srv_plugins
58 56
 }
59 57
 
60 58
 function neutron_plugin_configure_service() {