Move NEUTRON_* definitions from plugin.sh into settings file

If devstack triggers a plugin that directly imports from devstack/lib/*
before triggering neutron's plugin.sh, NEUTRON_* variables that are used
in some devstack/lib/* files may not be set.

The ``settings`` file is sourced by devstack for all repos before any of
plugins enabled in the environment is triggered, and so moving NEUTRON_*
definitions there should guarantee for us that the variables are set
when the first enabled plugin is executed.

Since Q_PLUGIN_CONF_PATH and Q_PLUGIN_CONF_FILE are defined in
lib/neutron_plugins/ml2:neutron_plugin_configure_common, and we want to
avoid triggering that code from the plugin, we need to duplicate values
for NEUTRON_CORE_PLUGIN_CONF_PATH and NEUTRON_CORE_PLUGIN_CONF from
there.

Closes-Bug: #1675022
Change-Id: Ib65d3615fba270c2fd6c116218bbb95a29f56aa6
This commit is contained in:
Ihar Hrachyshka 2017-03-21 08:30:15 +00:00
parent 42d2fc2d8c
commit dd882bbc57
2 changed files with 9 additions and 7 deletions

View File

@ -1,12 +1,5 @@
LIBDIR=$DEST/neutron/devstack/lib
if is_neutron_legacy_enabled; then
NEUTRON_CORE_PLUGIN=$Q_PLUGIN
NEUTRON_AGENT=$Q_AGENT
NEUTRON_CORE_PLUGIN_CONF_PATH=$Q_PLUGIN_CONF_PATH
NEUTRON_CORE_PLUGIN_CONF=$Q_PLUGIN_CONF_FILE
fi
source $LIBDIR/dns
source $LIBDIR/flavors
source $LIBDIR/l2_agent

View File

@ -1 +1,10 @@
L2_AGENT_EXTENSIONS=${L2_AGENT_EXTENSIONS:-}
if is_neutron_legacy_enabled; then
NEUTRON_CORE_PLUGIN=$Q_PLUGIN
NEUTRON_AGENT=$Q_AGENT
# NOTE(ihrachys) those values are defined same way as in
# lib/neutron_plugins/ml2:neutron_plugin_configure_common
NEUTRON_CORE_PLUGIN_CONF_PATH=etc/neutron/plugins/ml2
NEUTRON_CORE_PLUGIN_CONF=$NEUTRON_CORE_PLUGIN_CONF_PATH/ml2_conf.ini
fi