From 1a26ba4a054017c285053e217e71e7f816f8df9e Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Thu, 8 Aug 2019 09:11:20 -0700 Subject: [PATCH] Use the infra pypi mirror for DIB This patch changes the devstack plugin to use the infra pypi mirror if one is declared in the environment. Depends-On: https://review.opendev.org/675468 Change-Id: Iae839b6e59c43bc4be1e12702b3e2197b038b4c2 --- devstack/plugin.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 64059a828a..60409489db 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -89,6 +89,21 @@ function build_octavia_worker_image { export PARAM_OCTAVIA_AMP_IMAGE_SIZE='-s '$OCTAVIA_AMP_IMAGE_SIZE fi + # Use the infra pypi mirror if it is available + if [[ -e /etc/ci/mirror_info.sh ]]; then + source /etc/ci/mirror_info.sh + fi + if [[ ${NODEPOOL_PYPI_MIRROR:+1} ]]; then + if [[ ${DIB_LOCAL_ELEMENTS:+1} ]]; then + export DIB_LOCAL_ELEMENTS="${DIB_LOCAL_ELEMENTS} pypi" + else + export DIB_LOCAL_ELEMENTS='pypi' + fi + export DIB_PYPI_MIRROR_URL=$NODEPOOL_PYPI_MIRROR + export DIB_PYPI_MIRROR_URL_1=$NODEPOOL_WHEEL_MIRROR + export DIB_PIP_RETRIES=0 + fi + if ! [ -f $OCTAVIA_AMP_IMAGE_FILE ]; then local dib_logs=/var/log/dib-build if [[ -e ${dib_logs} ]]; then