Return PIP_OPTS for load_nodepool_pip_opts

At the moment for some scenarios, like linters, where ansible bootstrap
is skipped, PIP_OPTS are undefined and linters fail due to that.

With patch we define PIP_OPTS to an empty value if
we're not in CI.

Alternatively we can patch scenarios independently
not to rely on existance of PIP_OPTS or export default in
gate-check-commit instead.

Change-Id: If451b4bc12bb0b0bfe3fe20494e99a07b59ab798
This commit is contained in:
Dmitriy Rabotyagov 2023-07-06 18:36:24 +02:00
parent aa558cc368
commit d458b1f46a

View File

@ -93,6 +93,8 @@ function load_nodepool_pip_opts {
if [[ -e /etc/ci/mirror_info.sh ]]; then
source /etc/ci/mirror_info.sh
export PIP_OPTS="--index-url ${NODEPOOL_PYPI_MIRROR} --trusted-host ${NODEPOOL_MIRROR_HOST} --extra-index-url ${NODEPOOL_WHEEL_MIRROR}"
else
export PIP_OPTS=${PIP_OPTS:-""}
fi
}