diff options
author | Scott Wittenburg <scott.wittenburg@kitware.com> | 2020-10-01 14:32:43 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-01 14:32:43 -0600 |
commit | d3d98075c5acef075ff4a8dc7fac77597a2a3985 (patch) | |
tree | 8b7597bb85ea8c235430fcca51f24812bfac97d2 /lib | |
parent | a2795519df8f84526b1a1c3aef7488bb1c526446 (diff) | |
download | spack-d3d98075c5acef075ff4a8dc7fac77597a2a3985.tar.gz spack-d3d98075c5acef075ff4a8dc7fac77597a2a3985.tar.bz2 spack-d3d98075c5acef075ff4a8dc7fac77597a2a3985.tar.xz spack-d3d98075c5acef075ff4a8dc7fac77597a2a3985.zip |
Fix fetch of spec.yaml files from buildcache (#19101)
Since those files currently exist in buildcaches (in S3 buckets) with
potentially different content types, we should be less restrictive in
what content types we accept when attempting to fetch them. This PR
removes the content type constraint so any file with the matching
name will be found.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/binary_distribution.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py index 242a1d2b66..c14c84e346 100644 --- a/lib/spack/spack/binary_distribution.py +++ b/lib/spack/spack/binary_distribution.py @@ -271,8 +271,7 @@ class BinaryDistributionCacheManager(object): # Fetch the hash first so we can check if we actually need to fetch # the index itself. try: - _, _, fs = web_util.read_from_url( - hash_fetch_url, 'text/plain') + _, _, fs = web_util.read_from_url(hash_fetch_url) fetched_hash = codecs.getreader('utf-8')(fs).read() except (URLError, web_util.SpackWebError) as url_err: tty.debug('Unable to read index hash {0}'.format( @@ -288,8 +287,7 @@ class BinaryDistributionCacheManager(object): # Fetch index itself try: - _, _, fs = web_util.read_from_url( - index_fetch_url, 'application/json') + _, _, fs = web_util.read_from_url(index_fetch_url) index_object_str = codecs.getreader('utf-8')(fs).read() except (URLError, web_util.SpackWebError) as url_err: tty.debug('Unable to read index {0}'.format(index_fetch_url), @@ -1162,8 +1160,7 @@ def try_direct_fetch(spec, force=False, full_hash_match=False): mirror.fetch_url, _build_cache_relative_path, specfile_name) try: - _, _, fs = web_util.read_from_url( - buildcache_fetch_url, 'text/plain') + _, _, fs = web_util.read_from_url(buildcache_fetch_url) fetched_spec_yaml = codecs.getreader('utf-8')(fs).read() except (URLError, web_util.SpackWebError, HTTPError) as url_err: tty.debug('Did not find {0} on {1}'.format( |