fix iscsi-boot element exiting build even if dracut-regenerate used

in CentOS build case building an image with "iscsi-boot" and "dracut-regenerate" will exit building because of statement "[ "$found" = 0 ]"

Change-Id: I1a6d60e9ec5f5cb508866c8376465c3e73551a30
This commit is contained in:
Noam Angel 2020-02-12 09:00:44 +00:00
parent 500e60dbf4
commit 48eac8b899

View File

@ -8,10 +8,8 @@ set -o pipefail
if [[ $DISTRO_NAME = "centos7" ]]; then if [[ $DISTRO_NAME = "centos7" ]]; then
eval declare -A image_elements=($(get_image_element_array)) eval declare -A image_elements=($(get_image_element_array))
found=0 if [[ ! "${image_elements[@]}" =~ "dracut-regenerate" ]]; then
for i in "${!image_elements[@]}"; do echo "The dracut-regenerate element is required!"
[ "$i" = "dracut-regenerate" ] && found=1 exit 1
done fi
[ "$found" = 0 ] && echo "The dracut-regenerate element is required!" && exit 1
fi fi