summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2016-03-18 14:42:24 +0100
committeralalazo <massimiliano.culpo@googlemail.com>2016-03-18 14:42:24 +0100
commit5f6f2d5f51fc3700dce13c6aa035943bbc42f6f7 (patch)
tree1f6e16e56122d70adeae1f48e6cade86249d9c6d /var
parentec8cc2b52839007f0825815c8cfdee8f9a8629a6 (diff)
downloadspack-5f6f2d5f51fc3700dce13c6aa035943bbc42f6f7.tar.gz
spack-5f6f2d5f51fc3700dce13c6aa035943bbc42f6f7.tar.bz2
spack-5f6f2d5f51fc3700dce13c6aa035943bbc42f6f7.tar.xz
spack-5f6f2d5f51fc3700dce13c6aa035943bbc42f6f7.zip
Revert "openssl : solved glitch to prevent spack to freeze when the network is unreachable"
This reverts commit 4cf4bf3a0343fc93d6f0c14dd89956fa03b8f738.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/openssl/package.py29
1 files changed, 12 insertions, 17 deletions
diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py
index 22d538531a..70afaf4038 100644
--- a/var/spack/repos/builtin/packages/openssl/package.py
+++ b/var/spack/repos/builtin/packages/openssl/package.py
@@ -1,4 +1,4 @@
-import urllib2
+import urllib
import llnl.util.tty as tty
from spack import *
@@ -37,22 +37,17 @@ class Openssl(Package):
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)
- if response.getcode() == 404:
- openssl_url = older_url
- # Checks if we already warned the user for this particular version of OpenSSL.
- # If not we display a warning message and mark this version
- if not warnings_given_to_user.get(version, False):
- tty.warn('This installation depends on an old version of OpenSSL, which may have known security issues. ')
- tty.warn('Consider updating to the latest version of this package.')
- tty.warn('More details at {homepage}'.format(homepage=Openssl.homepage))
- 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
+ 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.
+ # If not we display a warning message and mark this version
+ if not warnings_given_to_user.get(version, False):
+ tty.warn('This installation depends on an old version of OpenSSL, which may have known security issues. ')
+ tty.warn('Consider updating to the latest version of this package.')
+ tty.warn('More details at {homepage}'.format(homepage=Openssl.homepage))
+ warnings_given_to_user[version] = True
+ else:
openssl_url = latest_url
# Store the computed URL
openssl_urls[version] = openssl_url