Files
tripleo-image-elements/elements/os-refresh-config/install.d/os-refresh-config-source-install/10-os-refresh-config
Joseph Tole b5b3160ef1 Updates for virtualenv on debian bullseye
Change-Id: I67af2b17f59cc4d05c4fa217861992123da97758
2022-03-15 16:20:14 -04:00

47 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# We need to install this early in install.d because other elements will
# need to use os-refresh-config --print-base to know where to put files
set -eux
manifest=$(get-pip-manifest os-refresh-config)
# pip and virtualenv is installed by the pip-and-virtualenv element
if [[ "$DISTRO_NAME" == "debian" ]] && [[ "$DIB_RELEASE" == "stable" || "$DIB_RELEASE" == "bullseye" ]]
then
virtualenv /opt/stack/venvs/os-refresh-config
else
virtualenv --setuptools /opt/stack/venvs/os-refresh-config
fi
set +u
source /opt/stack/venvs/os-refresh-config/bin/activate
set -u
if [ -n "$manifest" ]; then
use-pip-manifest $manifest
else
# Need setuptools>=1.0 to manage connections when
# downloading from pypi using http_proxy and https_proxy
/opt/stack/venvs/os-refresh-config/bin/pip install -U pip
/opt/stack/venvs/os-refresh-config/bin/pip install -U 'setuptools>=1.0'
# bug #1293812 : Avoid easy_install triggering on pbr.
/opt/stack/venvs/os-refresh-config/bin/pip install -U 'pbr>=0.11'
/opt/stack/venvs/os-refresh-config/bin/pip install -U os-refresh-config
fi
# Write the manifest of what was installed
write-pip-manifest os-refresh-config
ln -s /opt/stack/venvs/os-refresh-config/bin/os-refresh-config /usr/local/bin/os-refresh-config
ln -s /opt/stack/venvs/os-refresh-config/bin/dib-run-parts /usr/local/bin/dib-run-parts
for d in pre-configure.d configure.d migration.d post-configure.d; do
install -m 0755 -o root -g root -d $(os-refresh-config --print-base)/$d
done
set +u
deactivate
set -u