Fail on element-info error

If element-info fails we do not detect it due to it being run in a
subshell. Whenever this happens it is a terminal error (theres no way we
can run without an expanded set of elements) so lets detect and fail
early.

Change-Id: Ibdeecf19bc2824982273ef5cda6d7b7b614e484e
This commit is contained in:
Gregory Haynes 2016-11-01 17:23:58 -07:00
parent 7cc65d3cbd
commit af69cb8020

View File

@ -228,8 +228,12 @@ function arg_to_elements() {
# element=$i # element=$i
# path=${image_elements[$i] # path=${image_elements[$i]
# done # done
eval "$(element-info --env $IMAGE_ELEMENT)" elinfo_out="$(element-info --env $IMAGE_ELEMENT)"
if [ $? -ne 0 ]; then
echo "ERROR: element-info failed to expand elements."
exit 1
fi
eval "$elinfo_out"
echo "Expanded element dependencies to: $IMAGE_ELEMENT" echo "Expanded element dependencies to: $IMAGE_ELEMENT"
} }