Merge "Added options to improve offline usage."

This commit is contained in:
Jenkins 2012-11-08 03:35:57 +00:00 committed by Gerrit Code Review
commit 3189611d2e
2 changed files with 9 additions and 4 deletions

View File

@ -7,6 +7,7 @@
# ``GLANCE_HOSTPORT`` # ``GLANCE_HOSTPORT``
# ``OFFLINE`` # ``OFFLINE``
# ``PIP_DOWNLOAD_CACHE`` # ``PIP_DOWNLOAD_CACHE``
# ``PIP_USE_MIRRORS``
# ``RECLONE`` # ``RECLONE``
# ``TRACK_DEPENDS`` # ``TRACK_DEPENDS``
# ``http_proxy``, ``https_proxy``, ``no_proxy`` # ``http_proxy``, ``https_proxy``, ``no_proxy``
@ -578,7 +579,8 @@ function is_set() {
# Wrapper for ``pip install`` to set cache and proxy environment variables # Wrapper for ``pip install`` to set cache and proxy environment variables
# Uses globals ``OFFLINE``, ``PIP_DOWNLOAD_CACHE``, ``TRACK_DEPENDES``, ``*_proxy` # Uses globals ``OFFLINE``, ``PIP_DOWNLOAD_CACHE``, ``PIP_USE_MIRRORS``,
# ``TRACK_DEPENDS``, ``*_proxy`
# pip_install package [package ...] # pip_install package [package ...]
function pip_install { function pip_install {
[[ "$OFFLINE" = "True" || -z "$@" ]] && return [[ "$OFFLINE" = "True" || -z "$@" ]] && return
@ -597,11 +599,14 @@ function pip_install {
CMD_PIP=/usr/bin/pip-python CMD_PIP=/usr/bin/pip-python
fi fi
fi fi
if [[ "$PIP_USE_MIRRORS" != "False" ]]; then
PIP_MIRROR_OPT="--use-mirrors"
fi
$SUDO_PIP PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-/var/cache/pip} \ $SUDO_PIP PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-/var/cache/pip} \
HTTP_PROXY=$http_proxy \ HTTP_PROXY=$http_proxy \
HTTPS_PROXY=$https_proxy \ HTTPS_PROXY=$https_proxy \
NO_PROXY=$no_proxy \ NO_PROXY=$no_proxy \
$CMD_PIP install --use-mirrors $@ $CMD_PIP install $PIP_MIRROR_OPT $@
} }

View File

@ -57,8 +57,8 @@ then
fi fi
# get nova # get nova
nova_zipball=$(echo $NOVA_REPO | sed "s:\.git$::;s:$:/zipball/$NOVA_BRANCH:g") NOVA_ZIPBALL_URL=${NOVA_ZIPBALL_URL:-$(echo $NOVA_REPO | sed "s:\.git$::;s:$:/zipball/$NOVA_BRANCH:g")}
wget $nova_zipball -O nova-zipball --no-check-certificate wget $NOVA_ZIPBALL_URL -O nova-zipball --no-check-certificate
unzip -o nova-zipball -d ./nova unzip -o nova-zipball -d ./nova
# install xapi plugins # install xapi plugins