From dd882bbc57e74e967047016d9f43735d3bfbb368 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Tue, 21 Mar 2017 08:30:15 +0000 Subject: [PATCH] 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 --- devstack/plugin.sh | 7 ------- devstack/settings | 9 +++++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 1216277daef..fe175314863 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -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 diff --git a/devstack/settings b/devstack/settings index b452f883145..88531f1e4df 100644 --- a/devstack/settings +++ b/devstack/settings @@ -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