2015-02-18 14:47:54 -06:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# lib/stack
|
|
|
|
#
|
2015-03-28 08:20:50 -05:00
|
|
|
# These functions are code snippets pulled out of ``stack.sh`` for easier
|
2015-02-18 14:47:54 -06:00
|
|
|
# re-use by Grenade. They can assume the same environment is available
|
2015-03-28 08:20:50 -05:00
|
|
|
# as in the lower part of ``stack.sh``, namely a valid stackrc has been sourced
|
|
|
|
# as well as all of the ``lib/*`` files for the services have been sourced.
|
2015-02-18 14:47:54 -06:00
|
|
|
#
|
|
|
|
# For clarity, all functions declared here that came from ``stack.sh``
|
|
|
|
# shall be named with the prefix ``stack_``.
|
|
|
|
|
|
|
|
|
2015-03-28 08:20:50 -05:00
|
|
|
# Functions
|
|
|
|
# ---------
|
|
|
|
|
2015-11-13 17:06:16 +09:00
|
|
|
# Generic service install handles venv creation if configured for service
|
2015-02-18 14:47:54 -06:00
|
|
|
# stack_install_service service
|
|
|
|
function stack_install_service {
|
|
|
|
local service=$1
|
|
|
|
if type install_${service} >/dev/null 2>&1; then
|
2015-05-07 21:06:24 +00:00
|
|
|
# FIXME(dhellmann): Needs to be python3-aware at some point.
|
2015-03-09 14:27:51 -05:00
|
|
|
if [[ ${USE_VENV} = True && -n ${PROJECT_VENV[$service]:-} ]]; then
|
2015-02-18 14:47:54 -06:00
|
|
|
rm -rf ${PROJECT_VENV[$service]}
|
2015-03-09 14:27:51 -05:00
|
|
|
source $TOP_DIR/tools/build_venv.sh ${PROJECT_VENV[$service]} ${ADDITIONAL_VENV_PACKAGES//,/ }
|
2015-02-18 14:47:54 -06:00
|
|
|
export PIP_VIRTUAL_ENV=${PROJECT_VENV[$service]:-}
|
2015-03-09 14:27:51 -05:00
|
|
|
|
|
|
|
# Install other OpenStack prereqs that might come from source repos
|
|
|
|
install_oslo
|
|
|
|
install_keystonemiddleware
|
2015-02-18 14:47:54 -06:00
|
|
|
fi
|
|
|
|
install_${service}
|
2015-03-09 14:27:51 -05:00
|
|
|
if [[ ${USE_VENV} = True && -n ${PROJECT_VENV[$service]:-} ]]; then
|
2015-02-18 14:47:54 -06:00
|
|
|
unset PIP_VIRTUAL_ENV
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|