Neutron: Define a utility function to add neutron service class
When enabling neutron service (i.e. enable_service q-xxx), related code
unconditionally adds a necessary plugin class to Q_SERVICE_PLUGIN_CLASSES.
Which may cause duplication in Q_SERVICE_PLUGIN_CLASSES when
Q_SERVICE_PLUGIN_CLASSES is explicitly specified in localrc.
As a result, neutron server fails to start.
This patch introduces a utility function to add service class,
and check duplication.
Closes-Bug: #1261291
Change-Id: Id2880c7647babfccc3e8d9fc60dd93c4b3997ed9
diff --git a/lib/neutron_plugins/ml2 b/lib/neutron_plugins/ml2
index b5b1873..ab4e347 100644
--- a/lib/neutron_plugins/ml2
+++ b/lib/neutron_plugins/ml2
@@ -54,11 +54,7 @@
Q_PLUGIN_CLASS="neutron.plugins.ml2.plugin.Ml2Plugin"
# The ML2 plugin delegates L3 routing/NAT functionality to
# the L3 service plugin which must therefore be specified.
- if [[ $Q_SERVICE_PLUGIN_CLASSES == '' ]]; then
- Q_SERVICE_PLUGIN_CLASSES=$ML2_L3_PLUGIN
- else
- Q_SERVICE_PLUGIN_CLASSES="$Q_SERVICE_PLUGIN_CLASSES,$ML2_L3_PLUGIN"
- fi
+ _neutron_service_plugin_class_add $ML2_L3_PLUGIN
}
function neutron_plugin_configure_service() {