From 2551854a0779737770a5930ba5e8ba2dddea56a3 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 24 Sep 2013 10:31:20 -0400 Subject: [PATCH] Use select-mirror in devstack-gate The select-mirror logic has grown more complex, but devstack-gate's mirror selection has not kept up. Instead of duplicating, just reuse the existing script. This change depends on: https://review.openstack.org/59196 https://review.openstack.org/58153 Change-Id: Icbc240b83961834083f6044b30abb7f1d7321306 --- devstack-vm-gate-wrap.sh | 45 ++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/devstack-vm-gate-wrap.sh b/devstack-vm-gate-wrap.sh index 1d46d9b7..a8c892d8 100755 --- a/devstack-vm-gate-wrap.sh +++ b/devstack-vm-gate-wrap.sh @@ -208,6 +208,25 @@ function setup_workspace { set +o xtrace } +function select_mirror { + + if [ "$DEVSTACK_GATE_REQS_INTEGRATION" -eq "0" ]; then + + ORG=$(dirname $ZUUL_PROJECT) + SHORT_PROJECT=$(basename $ZUUL_PROJECT) + $DEVSTACK_GATE_SELECT_MIRROR $ORG $SHORT_PROJECT + + cp ~/.pydistutils.cfg ~stack/.pydistutils.cfg + sudo cp ~/.pydistutils.cfg ~root/.pydistutils.cfg + + mkdir -p ~stack/.pip + sudo -u root mkdir -p ~root/.pip + + cp ~/.pip/pip.conf ~stack/.pip/pip.conf + sudo -u root cp ~/.pip/pip.conf ~root/.pip/pip.conf + fi +} + function setup_host { # Enabled detailed logging, since output of this function is redirected set -o xtrace @@ -259,27 +278,9 @@ function setup_host { sudo usermod -a -G vz stack fi - if [ "$DEVSTACK_GATE_REQS_INTEGRATION" -eq "0" \ - -o "$ZUUL_PROJECT" != "openstack/requirements" ]; then - cat < /tmp/pydistutils.cfg -[easy_install] -index_url = http://pypi.openstack.org/openstack -EOF - cat < /tmp/pip.conf -[global] -index-url = http://pypi.openstack.org/openstack -EOF - cp /tmp/pydistutils.cfg ~/.pydistutils.cfg - cp /tmp/pydistutils.cfg ~stack/.pydistutils.cfg - sudo cp /tmp/pydistutils.cfg ~root/.pydistutils.cfg - mkdir -p ~/.pip - mkdir -p ~stack/.pip - sudo -u root mkdir -p ~root/.pip - cp /tmp/pip.conf ~/.pip/pip.conf - cp /tmp/pip.conf ~stack/.pip/pip.conf - sudo -u root cp /tmp/pip.conf ~root/.pip/pip.conf + if [ -f $DEVSTACK_GATE_SELECT_MIRROR ] ; then + select_mirror fi - # Disable detailed logging as we return to the main script set +o xtrace } @@ -537,6 +538,10 @@ export DEVSTACK_GATE_TEMPEST_ALL=${DEVSTACK_GATE_TEMPEST_ALL:-0} # Set to 1 if running the openstack/requirements integration test export DEVSTACK_GATE_REQS_INTEGRATION=${DEVSTACK_GATE_REQS_INTEGRATION:-0} +# Set this variable to override the mirror selection script. Set to a +# nonexistant location to disable mirror selection +export DEVSTACK_GATE_SELECT_MIRROR=${DEVSTACK_GATE_SELECT_MIRROR:-/usr/local/jenkins/slave_scripts/select-mirror.sh} + if ! function_exists "gate_hook"; then # the command we use to run the gate function gate_hook {