Better check for pypi mirror host connectivity
Now that we have switched to region specific mirrors, we should look at the pip.conf for the host url/ip and try the ping/http check on that specific mirror Change-Id: I28e5988bc7b957f575323778589a974cb51dc7fd
This commit is contained in:
12
functions.sh
12
functions.sh
@@ -69,9 +69,15 @@ function _http_check {
|
||||
# do a few network tests to baseline how bad we are
|
||||
function network_sanity_check {
|
||||
echo "Performing network sanity check..."
|
||||
# pypi.openstack.org
|
||||
_ping_check pypi.openstack.org
|
||||
_http_check http://pypi.openstack.org/simple/
|
||||
PIP_CONFIG_FILE=$HOME/.pip/pip.conf
|
||||
if [[ -f $PIP_CONFIG_FILE ]]; then
|
||||
line=$(cat $PIP_CONFIG_FILE|grep index-url)
|
||||
pypi_url=${line#*=}
|
||||
pypi_host=$(echo $pypi_url|grep -Po '.*?//\K.*?(?=/)')
|
||||
|
||||
_ping_check $pypi_host
|
||||
_http_check $pypi_url
|
||||
fi
|
||||
|
||||
# rax ubuntu mirror
|
||||
_ping_check mirror.rackspace.com
|
||||
|
||||
Reference in New Issue
Block a user