check LIBS_FROM_GIT

after the glance_store vs. upper-constraints bug, it's probably worth
actually enforcing and sanity checking that devstack is doing what
it's being asked of with LIBS_FROM_GIT. This will hopefully reduce
user generated error.

This *might* not work with the current oslo naming, we'll have to test
and normalize that.

Change-Id: Iffef2007f99a0e932b68c4c897ebbfb748cac2b4
This commit is contained in:
Sean Dague 2015-09-08 07:12:48 -04:00
parent 2105b9f9ce
commit c71973eb04
2 changed files with 29 additions and 0 deletions

View File

@ -157,6 +157,28 @@ function use_library_from_git {
return $enabled
}
# determine if a package was installed from git
function lib_installed_from_git {
local name=$1
pip freeze 2>/dev/null | grep -- "$name" | grep -q -- '-e git'
}
# check that everything that's in LIBS_FROM_GIT was actually installed
# correctly, this helps double check issues with library fat fingering.
function check_libs_from_git {
local lib=""
local not_installed=""
for lib in $(echo ${LIBS_FROM_GIT} | tr "," " "); do
if ! lib_installed_from_git "$lib"; then
not_installed+=" $lib"
fi
done
# if anything is not installed, say what it is.
if [[ -n "$not_installed" ]]; then
die $LINENO "The following LIBS_FROM_GIT were not installed correct: $not_installed"
fi
}
# setup a library by name. If we are trying to use the library from
# git, we'll do a git based install, otherwise we'll punt and the
# library should be installed by a requirements pull from another

View File

@ -1373,9 +1373,16 @@ if [[ -x $TOP_DIR/local.sh ]]; then
$TOP_DIR/local.sh
fi
# Sanity checks
# =============
# Check the status of running services
service_check
# ensure that all the libraries we think we installed from git,
# actually were.
check_libs_from_git
# Bash completion
# ===============