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 d9b9a427aa.
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:
@@ -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 ----------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user