Revert "openssl : solved glitch to prevent spack to freeze when the network is unreachable"

This reverts commit 4cf4bf3a03.
This commit is contained in:
alalazo 2016-03-18 14:42:24 +01:00
parent ec8cc2b528
commit 5f6f2d5f51

View File

@ -1,4 +1,4 @@
import urllib2
import urllib
import llnl.util.tty as tty
from spack import *
@ -37,8 +37,7 @@ def url_for_version(self, version):
version_number = '.'.join([str(x) for x in version[:-1]])
older_url = older.format(version_number=version_number, version_full=version)
latest_url = latest.format(version=version)
try:
response = urllib2.urlopen(latest.format(version=version), timeout=5)
response = urllib.urlopen(latest.format(version=version))
if response.getcode() == 404:
openssl_url = older_url
# Checks if we already warned the user for this particular version of OpenSSL.
@ -50,10 +49,6 @@ def url_for_version(self, version):
warnings_given_to_user[version] = True
else:
openssl_url = latest_url
except urllib2.URLError:
tty.warn('Cannot connect to network to retrieve OpenSSL version. Using default url.')
warnings_given_to_user[version] = True
openssl_url = latest_url
# Store the computed URL
openssl_urls[version] = openssl_url
# Store the updated dictionary of URLS