Set IRONIC_AGENT_MULTIPATH_DRIVERS to '' when undefined

Sometimes we fail to build the IPA ramdisk with:
/tmp/in_target.d/finalise.d/98-regenerate-initramfs: line 13:
IRONIC_AGENT_MULTIPATH_DRIVERS: unbound variable

Let's make sure the env variable is set to 'be2iscsi iscsi_target_mod
dm_multipath' when it is not set as that is the default stated
in the README.

We also make sure to not use the --add-drivers parameter in case
IRONIC_AGENT_MULTIPATH_DRIVERS is set to ''

Change-Id: I4f22c84fb65c7bba6904c174ff6819c6eaee0c32
Closes-Bug: #1659493
This commit is contained in:
Michele Baldessari 2017-01-26 08:31:01 +01:00 committed by Yolanda Robla Mota
parent 9538a56022
commit 00b986959c
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,4 @@
if [ -z "${IRONIC_AGENT_MULTIPATH_DRIVERS:-}" ]; then
export IRONIC_AGENT_MULTIPATH_DRIVERS=${IRONIC_AGENT_MULTIPATH_DRIVERS:-"be2iscsi iscsi_target_mod dm_multipath"}
fi

View File

@ -10,4 +10,8 @@ RET=$(select-boot-kernel-initrd)
KERNEL_VERSION=`echo ${RET%:*} | sed 's/vmlinuz-//g'`
RAMDISK=/boot/${RET#*:}
dracut -v --force --add-drivers "$IRONIC_AGENT_MULTIPATH_DRIVERS" $RAMDISK $KERNEL_VERSION
if [ -z $IRONIC_AGENT_MULTIPATH_DRIVERS ]; then
dracut -v --force $RAMDISK $KERNEL_VERSION
else
dracut -v --force --add-drivers "$IRONIC_AGENT_MULTIPATH_DRIVERS" $RAMDISK $KERNEL_VERSION
fi