Fix fastest-infra-wheel-mirror.py for CentOS.

on CentOS:
In [2]: platform.linux_distribution()
Out[2]: ('CentOS Linux', '7.2.1511', 'Core')

Also don't add repo_build_pip_extra_indexes if the mirror list is empty

Change-Id: Ia17915a03e7460689a8e403f93bcc87485cde13d
This commit is contained in:
Marc Gariepy 2017-02-21 16:13:49 -05:00 committed by Marc Gariépy
parent 97ec7d2f7b
commit f09e0a27f5
2 changed files with 6 additions and 3 deletions

View File

@ -131,8 +131,11 @@ numThreads = min(MAX_THREADS, len(MIRROR_LIST))
workQueue = Queue.Queue() workQueue = Queue.Queue()
for url in MIRROR_LIST: for url in MIRROR_LIST:
# Build the complete URL # Build the complete URL
distro = platform.linux_distribution()[0].lower() distro = platform.linux_distribution()[0].split(' ')[0].lower()
version = platform.linux_distribution()[1] if distro == 'centos':
version = platform.linux_distribution()[1].split('.')[0]
else:
version = platform.linux_distribution()[1]
architecture = platform.machine() architecture = platform.machine()
fullUrl = url + distro + "-" + version + "-" + architecture + "/" fullUrl = url + distro + "-" + version + "-" + architecture + "/"
workQueue.put(fullUrl) workQueue.put(fullUrl)

View File

@ -61,7 +61,7 @@ lxc_net_address: 10.255.255.1
lxc_net_netmask: 255.255.255.0 lxc_net_netmask: 255.255.255.0
lxc_net_dhcp_range: 10.255.255.2,10.255.255.253 lxc_net_dhcp_range: 10.255.255.2,10.255.255.253
{% if repo_build_pip_extra_indexes is defined %} {% if repo_build_pip_extra_indexes is defined and repo_build_pip_extra_indexes|length > 0 %}
## Wheel mirrors for the repo_build to use ## Wheel mirrors for the repo_build to use
repo_build_pip_extra_indexes: repo_build_pip_extra_indexes:
{{ repo_build_pip_extra_indexes | to_nice_yaml }} {{ repo_build_pip_extra_indexes | to_nice_yaml }}