From d291355275288c27515d1a646c48498668641a4b Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Fri, 27 Jun 2014 23:26:34 -0700 Subject: [PATCH] Make select-mirror use the bandersnatch mirror A simple next step is to have select-mirror just default everything to the same thing. Change-Id: I9882167596de0791eda86397510e2a942848f5c5 --- modules/jenkins/files/pip.conf | 3 -- modules/jenkins/files/pydistutils.cfg | 2 - modules/openstack_project/files/pip.conf | 2 + .../openstack_project/files/pydistutils.cfg | 2 + .../files/slave_scripts/select-mirror.sh | 40 +++---------------- modules/openstack_project/manifests/slave.pp | 23 +++++++++++ 6 files changed, 32 insertions(+), 40 deletions(-) delete mode 100644 modules/jenkins/files/pip.conf delete mode 100644 modules/jenkins/files/pydistutils.cfg create mode 100644 modules/openstack_project/files/pip.conf create mode 100644 modules/openstack_project/files/pydistutils.cfg diff --git a/modules/jenkins/files/pip.conf b/modules/jenkins/files/pip.conf deleted file mode 100644 index 57f63b54d9..0000000000 --- a/modules/jenkins/files/pip.conf +++ /dev/null @@ -1,3 +0,0 @@ -[global] -index-url = http://pypi.openstack.org -extra-index-url = http://pypi.python.org/simple diff --git a/modules/jenkins/files/pydistutils.cfg b/modules/jenkins/files/pydistutils.cfg deleted file mode 100644 index 9d1de1569f..0000000000 --- a/modules/jenkins/files/pydistutils.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[easy_install] -index_url = http://pypi.openstack.org diff --git a/modules/openstack_project/files/pip.conf b/modules/openstack_project/files/pip.conf new file mode 100644 index 0000000000..99ebe731cc --- /dev/null +++ b/modules/openstack_project/files/pip.conf @@ -0,0 +1,2 @@ +[global] +index-url = http://pypi.openstack.org/simple diff --git a/modules/openstack_project/files/pydistutils.cfg b/modules/openstack_project/files/pydistutils.cfg new file mode 100644 index 0000000000..90c65a86d4 --- /dev/null +++ b/modules/openstack_project/files/pydistutils.cfg @@ -0,0 +1,2 @@ +[easy_install] +index_url = http://pypi.openstack.org/simple diff --git a/modules/openstack_project/files/slave_scripts/select-mirror.sh b/modules/openstack_project/files/slave_scripts/select-mirror.sh index 9ea4598250..4a9df3f513 100755 --- a/modules/openstack_project/files/slave_scripts/select-mirror.sh +++ b/modules/openstack_project/files/slave_scripts/select-mirror.sh @@ -14,44 +14,14 @@ # License for the specific language governing permissions and limitations # under the License. -org=$1 -project=$2 - -source /usr/local/jenkins/slave_scripts/functions.sh -check_variable_org_project "$org" "$project" "$0" - -rm -f ~/.pydistutils.cfg mkdir -p ~/.pip -rm -f ~/.pip/pip.conf -# Start with a default pip.conf for use with pypi.python.org -# (which may be overwritten later) +cat < ~/.pydistutils.cfg +[easy_install] +index_url = http://pypi.openstack.org/simple +EOF cat < ~/.pip/pip.conf [global] +index-url = http://pypi.openstack.org/simple timeout = 60 EOF - -# 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 - export TOX_INDEX_URL='http://pypi.openstack.org/openstack' - echo "Switching on internal pypi mirror $TOX_INDEX_URL for $org/$project" - cat < ~/.pydistutils.cfg -[easy_install] -index_url = http://pypi.openstack.org/openstack -EOF - cat < ~/.pip/pip.conf -[global] -index-url = http://pypi.openstack.org/openstack -timeout = 60 -EOF -else - echo "$org/$project will not use the internal openstack pypi mirror" - cat < ~/.pip/pip.conf -[global] -timeout = 60 -index-url = http://pypi.openstack.org/openstack -extra-index-url = http://pypi.python.org/simple -EOF -fi diff --git a/modules/openstack_project/manifests/slave.pp b/modules/openstack_project/manifests/slave.pp index 6365f9b6d8..9bf3a7e204 100644 --- a/modules/openstack_project/manifests/slave.pp +++ b/modules/openstack_project/manifests/slave.pp @@ -27,6 +27,29 @@ class openstack_project::slave ( python3 => $python3, } + file { '/home/jenkins/.pydistutils.cfg': + ensure => present, + owner => 'jenkins', + group => 'jenkins', + mode => '0644', + source => 'puppet:///modules/openstack_project/pydistutils.cfg', + require => Class['jenkins::slave'], + } + + file { '/home/jenkins/.pip': + ensure => directory, + require => Class['jenkins::slave'], + } + + file { '/home/jenkins/.pip/pip.conf': + ensure => present, + owner => 'jenkins', + group => 'jenkins', + mode => '0644', + source => 'puppet:///modules/openstack_project/pip.conf', + require => File['/home/jenkins/.pip'], + } + class { 'salt': salt_master => 'ci-puppetmaster.openstack.org', }