Support common venv for os-*-config

All the openstack services support being installed into their own venv,
or into a common one. why not these two? This should cut some time off
builds.

Change-Id: Iab90372ba84993da6a2cb600ce1fef6fc073d3f6
This commit is contained in:
Gregory Haynes 2015-01-20 16:03:15 -08:00
parent bd878c7f2a
commit 2d99b4a608
4 changed files with 18 additions and 12 deletions

View File

@ -0,0 +1,3 @@
if [ -z "${OS_APPLY_CONFIG_VENV_DIR:-}" ]; then
export OS_APPLY_CONFIG_VENV_DIR=${OPENSTACK_VENV_DIR:-"/opt/stack/venvs/os-apply-config"}
fi

View File

@ -3,9 +3,9 @@ set -eux
manifest=$(get-pip-manifest os-apply-config)
virtualenv --setuptools /opt/stack/venvs/os-apply-config
virtualenv --setuptools $OS_APPLY_CONFIG_VENV_DIR
set +u
source /opt/stack/venvs/os-apply-config/bin/activate
source $OS_APPLY_CONFIG_VENV_DIR/bin/activate
set -u
if [ -n "$manifest" ]; then
@ -15,16 +15,16 @@ else
# doesn't manage correctly HTTPS sockets when downloading pbr from
# https://pypi.python.org/simple/ if using http_proxy and https_proxy
# envvars
/opt/stack/venvs/os-apply-config/bin/pip install -U 'setuptools>=1.0'
$OS_APPLY_CONFIG_VENV_DIR/bin/pip install -U 'setuptools>=1.0'
# bug #1293812 : Avoid easy_install triggering on pbr.
/opt/stack/venvs/os-apply-config/bin/pip install -U 'pbr>=0.6,<1.0'
/opt/stack/venvs/os-apply-config/bin/pip install -U os-apply-config
$OS_APPLY_CONFIG_VENV_DIR/bin/pip install -U 'pbr>=0.6,<1.0'
$OS_APPLY_CONFIG_VENV_DIR/bin/pip install -U os-apply-config
fi
# Write the manifest of what was installed
write-pip-manifest os-apply-config
ln -s /opt/stack/venvs/os-apply-config/bin/os-apply-config /usr/local/bin/os-apply-config
ln -s $OS_APPLY_CONFIG_VENV_DIR/bin/os-apply-config /usr/local/bin/os-apply-config
set +u
deactivate

View File

@ -0,0 +1,3 @@
if [ -z "${OS_COLLECT_CONFIG_VENV_DIR:-}" ]; then
export OS_COLLECT_CONFIG_VENV_DIR=${OPENSTACK_VENV_DIR:-"/opt/stack/venvs/os-collect-config"}
fi

View File

@ -3,9 +3,9 @@ set -eux
manifest=$(get-pip-manifest os-collect-config)
virtualenv --setuptools /opt/stack/venvs/os-collect-config
virtualenv --setuptools $OS_COLLECT_CONFIG_VENV_DIR
set +u
source /opt/stack/venvs/os-collect-config/bin/activate
source $OS_COLLECT_CONFIG_VENV_DIR/bin/activate
set -u
if [ -n "$manifest" ]; then
@ -13,16 +13,16 @@ if [ -n "$manifest" ]; then
else
# Need setuptools>=1.0 to manage connections when
# downloading from pypi using http_proxy and https_proxy
/opt/stack/venvs/os-collect-config/bin/pip install -U 'setuptools>=1.0'
$OS_COLLECT_CONFIG_VENV_DIR/bin/pip install -U 'setuptools>=1.0'
# bug #1293812 : Avoid easy_install triggering on pbr.
/opt/stack/venvs/os-collect-config/bin/pip install -U 'pbr>=0.6,<1.0'
/opt/stack/venvs/os-collect-config/bin/pip install -U os-collect-config
$OS_COLLECT_CONFIG_VENV_DIR/bin/pip install -U 'pbr>=0.6,<1.0'
$OS_COLLECT_CONFIG_VENV_DIR/bin/pip install -U os-collect-config
fi
# Write the manifest of what was installed
write-pip-manifest os-collect-config
ln -s /opt/stack/venvs/os-collect-config/bin/os-collect-config /usr/local/bin/os-collect-config
ln -s $OS_COLLECT_CONFIG_VENV_DIR/bin/os-collect-config /usr/local/bin/os-collect-config
# Minimal static config for bootstrapping
cat > /etc/os-collect-config.conf <<eof