summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanou Ishii <ishii.vanou@fujitsu.com>2021-02-01 08:15:42 +0900
committerVanou Ishii <ishii.vanou@fujitsu.com>2021-02-01 10:17:39 +0900
commit13e77e2179937f7fdf42ae40bc58af9909721526 (patch)
treebf0b4eeb6d3cc80c00a2602d81fd411866d6f328
parent4a7d50ce56b88c82e95665ac6df44666d3e647ed (diff)
downloadironic-13e77e2179937f7fdf42ae40bc58af9909721526.tar.gz
Fix Mis-Ordering of Bash Variable Definition in DevStack
In devstack/lib/ironic, IRONIC_DEPLOY_DRIVER is defined at line 341. However variables which use IRONIC_DEPLOY_DRIVER in default value (e.g. IRONIC_DEPLOY_RAMDISK, IRONIC_DEPLOY_KERNEL, IRONIC_DEPLOY_ISO and IRONIC_EFIBOOT) are defined at line 276-282. This will cause problem at line 295-296: if [[ "$IRONIC_BUILD_DEPLOY_RAMDISK" == "False" && \ ! (-e "$IRONIC_DEPLOY_RAMDISK" && -e "$IRONIC_DEPLOY_KERNEL") So, this commit moves definition of IRONIC_DEPLOY_DRIVER before its first use. Change-Id: I74acb32714ce8830d4697fc796146b894aa7d8c9
-rw-r--r--devstack/lib/ironic13
1 files changed, 7 insertions, 6 deletions
diff --git a/devstack/lib/ironic b/devstack/lib/ironic
index d1c98f597..69f26b8fd 100644
--- a/devstack/lib/ironic
+++ b/devstack/lib/ironic
@@ -271,6 +271,13 @@ if [[ "$hostdomain" =~ "rax" ]]; then
fi
fi
+# Which deploy driver to use - valid choices right now
+# are ``ipmi``, ``snmp`` and ``redfish``.
+#
+# Additional valid choices if IRONIC_IS_HARDWARE == true are:
+# ``idrac`` and ``irmc``.
+IRONIC_DEPLOY_DRIVER=${IRONIC_DEPLOY_DRIVER:-ipmi}
+
# If present, these files are used as deploy ramdisk/kernel.
# (The value must be an absolute path)
IRONIC_DEPLOY_RAMDISK=${IRONIC_DEPLOY_RAMDISK:-$TOP_DIR/files/ir-deploy-$IRONIC_DEPLOY_DRIVER.initramfs}
@@ -333,12 +340,6 @@ if [[ "$IRONIC_DEPLOY_ISO_REQUIRED" = "True" \
die "Prebuilt ISOs are not available, provide an ISO via IRONIC_DEPLOY_ISO \
or set IRONIC_BUILD_DEPLOY_RAMDISK=True to use ISOs"
fi
-# Which deploy driver to use - valid choices right now
-# are ``ipmi``, ``snmp`` and ``redfish``.
-#
-# Additional valid choices if IRONIC_IS_HARDWARE == true are:
-# ``idrac`` and ``irmc``.
-IRONIC_DEPLOY_DRIVER=${IRONIC_DEPLOY_DRIVER:-ipmi}
# If the requested driver is not yet enable, enable it, if it is not it will fail anyway
if [[ -z "$(echo ${IRONIC_ENABLED_HARDWARE_TYPES} | grep -w ${IRONIC_DEPLOY_DRIVER})" ]]; then