diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2014-12-02 09:58:30 -0800 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2014-12-02 09:58:30 -0800 |
commit | e71cf672f19565b8cc5b7f1aaec33dca6a3a74f4 (patch) | |
tree | e8bd05c3a2e1ed5b50105f4521262596077966ee | |
parent | d2fe038cafc2fb2f8835bc1d4e51df4b567c0e59 (diff) | |
download | spack-e71cf672f19565b8cc5b7f1aaec33dca6a3a74f4.tar.gz spack-e71cf672f19565b8cc5b7f1aaec33dca6a3a74f4.tar.bz2 spack-e71cf672f19565b8cc5b7f1aaec33dca6a3a74f4.tar.xz spack-e71cf672f19565b8cc5b7f1aaec33dca6a3a74f4.zip |
Fail fast in stage if all fetch strategies fail for a package.
-rw-r--r-- | lib/spack/spack/fetch_strategy.py | 12 | ||||
-rw-r--r-- | lib/spack/spack/stage.py | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index d48b999ddc..0e848652ae 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -156,9 +156,10 @@ class URLFetchStrategy(FetchStrategy): if spack.curl.returncode == 22: # This is a 404. Curl will print the error. - raise FailedDownloadError(self.url) + raise FailedDownloadError( + self.url, "URL %s was not found!" % self.url) - if spack.curl.returncode == 60: + elif spack.curl.returncode == 60: # This is a certificate error. Suggest spack -k raise FailedDownloadError( self.url, @@ -168,6 +169,13 @@ class URLFetchStrategy(FetchStrategy): "can try running spack -k, which will not check SSL certificates." "Use this at your own risk.") + else: + # This is some other curl error. Curl will print the + # error, but print a spack message too + raise FailedDownloadError( + self.url, "Curl failed with error %d", spack.curl.returncode) + + # Check if we somehow got an HTML file rather than the archive we # asked for. We only look at the last content type, to handle # redirects properly. diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py index f09346ab9b..84454c9d2c 100644 --- a/lib/spack/spack/stage.py +++ b/lib/spack/spack/stage.py @@ -260,6 +260,8 @@ class Stage(object): tty.msg("Fetching from %s failed." % fetcher) tty.debug(e) continue + else: + tty.die("All fetchers failed for %s" % self.name) def check(self): |