]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Now starts the openvswitch agent using the ml2 config if this is the plugin which...
authorThomas Goirand <thomas@goirand.fr>
Tue, 26 Nov 2013 09:43:53 +0000 (17:43 +0800)
committerThomas Goirand <thomas@goirand.fr>
Tue, 26 Nov 2013 09:43:53 +0000 (17:43 +0800)
Change-Id: Ifb42e1993d86072656db9244b84c41167d93b5f8

debian/changelog
debian/neutron-plugin-openvswitch-agent.init

index 8e55f70628521fe0398a5d3f989c5ea1f8cabc65..bd2e1144136436f1e91b5da9e1242e1bb2f8f1ae 100644 (file)
@@ -1,6 +1,7 @@
 neutron (2013.2-6) unstable; urgency=low
 
-  * Adds missing ml2 binary package.
+  * Now starts the openvswitch agent using the ml2 config if this is the plugin
+    which is in use in the core_plugin directive.
 
  -- Thomas Goirand <zigo@debian.org>  Mon, 25 Nov 2013 17:21:56 +0000
 
index 76cce5ca28ee61850b7c34013ed8f84409aeaf95..96b2751d2b92bfd6af79179988f601b7d2ceee0c 100644 (file)
@@ -18,7 +18,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="Openstack Neutron OpenVSwitch Plugin Agent"
 NAME=neutron-openvswitch-agent
 DAEMON=/usr/bin/neutron-openvswitch-agent
-DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini --log-file=/var/log/neutron/ovs-agent.log"
+DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --log-file=/var/log/neutron/ovs-agent.log"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 CONF_FILE=/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
@@ -31,6 +31,28 @@ CONF_FILE=/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
 
 . /lib/lsb/init-functions
 
+[ -r /usr/share/neutron-common/plugin_guess_func ] || exit 0
+. /usr/share/neutron-common/plugin_guess_func
+
+### Maintain the plugin selection so that we can load the corresponding .ini file ###
+if ! [ -r /etc/neutron/neutron.conf ] ; then
+       echo "Cloud not read /etc/neutron/neutron.conf: exiting"
+       exit 0
+fi
+
+CURRENT_PLUGIN=`grep "^[ \t]*core_plugin[ \t]*=[ \t]*[._a-zA-Z0-9]*\$" /etc/neutron/neutron.conf | sed -e 's/^[ \t]*core_plugin[ \t]*=[ \t]*//'`
+if [ -z "${CURRENT_PLUGIN}" ] ; then
+       echo "No core_plugin= value found: please set it and try again"
+       exit 0
+fi
+neutron_core_plugin_to_plugin_name ${CURRENT_PLUGIN}
+neutron_plugin_ini_path ${NEUTRON_PLUGIN_NAME}
+if [ -z "${NEUTRON_PLUGIN_CONFIG}" ] ; then
+       echo "Plugin not recognized: please edit /etc/init.d/neutron-server to select the correct .ini file to load for your plugin"
+else
+       DAEMON_ARGS="${DAEMON_ARGS} --config-file=${NEUTRON_PLUGIN_CONFIG}"
+       DESC="${DESC} with ${NEUTRON_PLUGIN_NAME} plugin"
+fi
 
 do_start()
 {