From e3f7b0561e1a71e6fa90616ad28debbf1e2902f5 Mon Sep 17 00:00:00 2001
From: Monty Taylor <mordred@inaugust.com>
Date: Fri, 29 Nov 2013 09:19:23 -0500
Subject: [PATCH] Use requirements project list for mirror selection

The openstack/requirements repo maintains a list of projects that have
opted in to receiving automatic updates. Those projects clearly want to
be beholden to the mirror as well, so consume that for mirror choice
instead of trying to figure it out via rules based on name.

Change-Id: I5c65287fabe43fc3e6dec315b29c13788bd3c1ea
---
 modules/jenkins/files/slave_scripts/select-mirror.sh | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/modules/jenkins/files/slave_scripts/select-mirror.sh b/modules/jenkins/files/slave_scripts/select-mirror.sh
index d2d761d684..6bdbc7c525 100755
--- a/modules/jenkins/files/slave_scripts/select-mirror.sh
+++ b/modules/jenkins/files/slave_scripts/select-mirror.sh
@@ -37,13 +37,9 @@ cat <<EOF > ~/.pip/pip.conf
 timeout = 60
 EOF
 
-# Noop, do not setup any mirrors to allow requirements to talk to the
-# outside world.
-if [ "$org" == "openstack" ] && [ "$project" == "requirements" ]
-then
-    echo "Not changing mirror"
-# For OpenStack projects, use the pypi.openstack.org mirror exclusively
-elif [ "$org" == "openstack" ]
+# For project listed in openstack/requirements,
+# use the pypi.openstack.org mirror exclusively
+if grep -x "$org/$project" /opt/requirements/projects.txt 2>&1
 then
     # wheel mirrors are below a dir level containing distro and release
     # because the wheel format itself does not distinguish