Validate the target directory exists before linking.

If you run the script manually and export the target release to another tag, it
might generate a broken link, this ensure the target exists.

Change-Id: Ia18bd7796f5f48c42ad9c23e917ddb37aa8103b3
This commit is contained in:
Marc Gariepy 2017-11-24 11:46:39 -05:00 committed by Marc Gariépy (mgariepy)
parent 0421a02e0c
commit 2ccc760da8

View File

@ -430,6 +430,10 @@ function link_release {
if [[ -d "/opt/openstack-ansible" ]]; then
mv "/opt/openstack-ansible" "/opt/openstack-ansible.bak"
fi
if [[ ! -d "$1" ]]; then
failure "Make sure the target "$1" exists. "
exit 99
fi
ln -sf "$1" "/opt/openstack-ansible"
}