Fail build-image if public key is not present

User must have a public key setup for build-image.sh to succeed. Fail
early if it is missing.

Change-Id: Ib02cf3d4101fa93fc8ee234650658176d390b611
This commit is contained in:
John L. Villalovos
2016-10-14 14:25:24 -07:00
parent 73020031d3
commit 2b5479e412

View File

@@ -29,6 +29,13 @@ export CONFIG_SOURCE=${CONFIG_SOURCE:-https://git.openstack.org/openstack-infra/
export CONFIG_REF=${CONFIG_REF:-master}
export EXTRA_ELEMENTS=${EXTRA_ELEMENTS:-}
ZUUL_USER_SSH_PUBLIC_KEY=${ZUUL_USER_SSH_PUBLIC_KEY:-$HOME/.ssh/id_rsa.pub}
if [ ! -f ${ZUUL_USER_SSH_PUBLIC_KEY} ]; then
echo "Error: There is no SSH public key at: ${ZUUL_USER_SSH_PUBLIC_KEY}"
echo "Error: Image build will fail. Exiting now."
exit 1
fi
# The list of elements here should match nodepool/nodepool.yaml
disk-image-create -x --no-tmpfs -o $IMAGE_NAME \
$DISTRO \