summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn L. Villalovos <john.l.villalovos@intel.com>2017-03-10 06:45:59 -0800
committerJohn L. Villalovos <john.l.villalovos@intel.com>2017-03-13 08:22:21 -0700
commitc04164da9c5ae44fe68b1524dea61d11deea7c50 (patch)
tree003abc46ff08fdf1c3e9a0c3b004b6630be92e4e
parent91540cd7f10cdc8eacc7876e7bb41a978a1ee6d9 (diff)
downloadironic-c04164da9c5ae44fe68b1524dea61d11deea7c50.tar.gz
grenade: Only 'enable_plugin ironic' if not already in conf
To support multi-node grenade jobs we need to move enabling of the ironic devstack plugin out of the ironic grenade settings file devstack/upgrade/settings. But if we add enabling of the ironic devstack plugin to project-config it will cause the gate to break as the plugin will be enabled twice. This checks to see if the ironic devstack plugin has already been enabled: * If it has already been enabled it will not enable it again. * If it has not yet been enabled it will enable it. This will allow us to update project-config to enable the ironic devstack plugin and not break the gate. After all the changes have landed we will propose a follow-up patch to remove all this additonal logic and the enabling of the ironic devstack plugin. Change-Id: I09ed78ef918eb0359045350e89d42c6df9f3e490 (cherry picked from commit 0be91665b41ff62aaafd2e204f9ff905b968e132)
-rw-r--r--devstack/upgrade/settings24
1 files changed, 20 insertions, 4 deletions
diff --git a/devstack/upgrade/settings b/devstack/upgrade/settings
index cfd939858..7ec9659be 100644
--- a/devstack/upgrade/settings
+++ b/devstack/upgrade/settings
@@ -10,11 +10,27 @@
register_project_for_upgrade ironic
register_db_to_save ironic
-devstack_localrc base enable_plugin ironic https://git.openstack.org/openstack/ironic
-devstack_localrc base enable_service ir-api ir-cond ironic
-devstack_localrc target enable_plugin ironic https://git.openstack.org/openstack/ironic
-devstack_localrc target enable_service ir-api ir-cond ironic
+# NOTE(jlvillal): This file is sourced by the 'load_settings' function in
+# grenade/inc/plugin. So usage of local will work.
+local ir_gren_conf
+local ir_gren_stage
+
+for ir_gren_stage in base target; do
+ # TODO(jlvillal): Remove this logic for checking if the ironic devstack
+ # plugin is enabled, once the enabling of the ironic devstack plugin is
+ # being done in project-config.
+ ir_gren_conf=$(localrc_path ${ir_gren_stage})
+ # Only 'enable_plugin ironic' if it isn't in the file already.
+ if ! grep -q '^enable_plugin ironic ' ${ir_gren_conf} ; then
+ echo "Enabling ironic devstack plugin via grenade for ${ir_gren_stage}"
+ devstack_localrc ${ir_gren_stage} enable_plugin ironic https://git.openstack.org/openstack/ironic
+ else
+ echo "ironic devstack plugin already enabled for ${ir_gren_stage}"
+ fi
+
+ devstack_localrc ${ir_gren_stage} enable_service ir-api ir-cond ironic
+done
# Duplicate some setup bits from target DevStack. Use old devstack as we install base environment from it.
BASE_TOP_DIR=$TOP_DIR/../../old/devstack/