Allow scripts-library.sh to be sourced anywhere

Currently, we cannot source scripts-library.sh from anywhere outside of
the top-level of the openstack-ansible checkout.  This behaviour
changed with commit d9b9a427aa03f866458bdffc220c596c7b4b5bb2.

This commit itself updates scripts-library.sh to use $BASH_SOURCE to
find the location of os-detection.py, allowing scripts-library.sh to
be sourced from any external project without having to cd into the
openstack-ansible checkout and back out again.

Change-Id: Ia5cec5a0f1af4f8d4998465923077c87ffaf24ef
Closes-Bug: #1510443
This commit is contained in:
Matt Thompson 2015-10-27 09:52:25 +00:00
parent 50ea4c81b9
commit b5a6381457

View File

@ -328,7 +328,7 @@ trap "exit_fail ${LINENO} $?" ERR
## Determine OS --------------------------------------------------------------
# Determine the operating system of the base host
# Adds the $HOST_DISTRO, $HOST_VERSION, and $HOST_CODENAME bash variables.
eval "$(python $(dirname ${0})/os-detection.py)"
eval "$(python $(dirname ${BASH_SOURCE})/os-detection.py)"
echo "Detected ${HOST_DISTRO} ${HOST_VERSION} (codename: ${HOST_CODENAME})"
## Pre-flight check ----------------------------------------------------------