8c2ce6ea |
#!/bin/bash
#
# lib/stack
# |
dc97cb71 |
# These functions are code snippets pulled out of ``stack.sh`` for easier |
8c2ce6ea |
# re-use by Grenade. They can assume the same environment is available |
dc97cb71 |
# 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. |
8c2ce6ea |
#
# For clarity, all functions declared here that came from ``stack.sh``
# shall be named with the prefix ``stack_``.
|
dc97cb71 |
# Functions
# ---------
|
8c2ce6ea |
# Generic service install handles venv creation if confgured for service
# stack_install_service service
function stack_install_service {
local service=$1
if type install_${service} >/dev/null 2>&1; then |
5686dbc4 |
if [[ ${USE_VENV} = True && -n ${PROJECT_VENV[$service]:-} ]]; then |
8c2ce6ea |
rm -rf ${PROJECT_VENV[$service]} |
5686dbc4 |
source $TOP_DIR/tools/build_venv.sh ${PROJECT_VENV[$service]} ${ADDITIONAL_VENV_PACKAGES//,/ } |
8c2ce6ea |
export PIP_VIRTUAL_ENV=${PROJECT_VENV[$service]:-} |
5686dbc4 |
# Install other OpenStack prereqs that might come from source repos
install_oslo
install_keystonemiddleware |
8c2ce6ea |
fi
install_${service} |
5686dbc4 |
if [[ ${USE_VENV} = True && -n ${PROJECT_VENV[$service]:-} ]]; then |
8c2ce6ea |
unset PIP_VIRTUAL_ENV
fi
fi
} |