diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2018-08-22 15:55:28 -0500 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2018-09-03 20:42:01 -0700 |
commit | 0ca69fef42e8325a3d8d6f70dcacc7787526ef5f (patch) | |
tree | fcffaf2b721493d1287080157ee2e0b6a6a6c18f /lib | |
parent | 3c9b0ee2ea2c1f4fc983312f08d6ffd36c1818f0 (diff) | |
download | spack-0ca69fef42e8325a3d8d6f70dcacc7787526ef5f.tar.gz spack-0ca69fef42e8325a3d8d6f70dcacc7787526ef5f.tar.bz2 spack-0ca69fef42e8325a3d8d6f70dcacc7787526ef5f.tar.xz spack-0ca69fef42e8325a3d8d6f70dcacc7787526ef5f.zip |
Better warning message when fetching non-existent URL
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/fetch_strategy.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index f5425d6bbd..5fdbaa9695 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -306,13 +306,13 @@ class URLFetchStrategy(FetchStrategy): content_types = re.findall(r'Content-Type:[^\r\n]+', headers, flags=re.IGNORECASE) if content_types and 'text/html' in content_types[-1]: - tty.warn("The contents of ", - (self.archive_file if self.archive_file is not None - else "the archive"), - " look like HTML.", - "The checksum will likely be bad. If it is, you can use", - "'spack clean <package>' to remove the bad archive, then", - "fix your internet gateway issue and install again.") + msg = ("The contents of {0} look like HTML. Either the URL " + "you are trying to use does not exist or you have an " + "internet gateway issue. You can remove the bad archive " + "using 'spack clean <package>', then try again using " + "the correct URL.") + tty.warn(msg.format(self.archive_file or "the archive")) + if save_file: os.rename(partial_file, save_file) |