summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Scheibel <scheibel1@llnl.gov>2019-10-23 16:50:51 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2019-10-23 16:50:51 -0700
commitf2ddffb8400934d6b2e975d359be22c1997d6863 (patch)
tree24d43025376377d93de365e8fcee27f79791cd56
parentbd7265ed5226078fd13d2fe55164a5e53f3193e3 (diff)
downloadspack-f2ddffb8400934d6b2e975d359be22c1997d6863.tar.gz
spack-f2ddffb8400934d6b2e975d359be22c1997d6863.tar.bz2
spack-f2ddffb8400934d6b2e975d359be22c1997d6863.tar.xz
spack-f2ddffb8400934d6b2e975d359be22c1997d6863.zip
bugfix: web.push_to_url should not format the local path that is passed to it (#13408)
fd58c98 formats the `Stage`'s `archive_path` in `Stage.archive` (as part of `web.push_to_url`). This is not needed and if the formatted differs from the original path (for example if the archive file name contains a URL query suffix), then the copy fails. This removes the formatting that occurs in `web.push_to_url`. We should figure out a way to handle bad cases like this *and* to have nicer filenames for downloaded files. One option that would work in this particular case would be to also pass `-J` / `--remote-header-name` to `curl`. We'll need to do follow-up work to determine if we can use `-J` everywhere. See also: https://github.com/spack/spack/pull/11117#discussion_r338301058
-rw-r--r--lib/spack/spack/util/web.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/spack/spack/util/web.py b/lib/spack/spack/util/web.py
index e0a23fb444..abf549cc89 100644
--- a/lib/spack/spack/util/web.py
+++ b/lib/spack/spack/util/web.py
@@ -203,14 +203,9 @@ def warn_no_ssl_cert_checking():
"your Python to enable certificate verification.")
-def push_to_url(local_path, remote_path, **kwargs):
+def push_to_url(local_file_path, remote_path, **kwargs):
keep_original = kwargs.get('keep_original', True)
- local_url = url_util.parse(local_path)
- local_file_path = url_util.local_file_path(local_url)
- if local_file_path is None:
- raise ValueError('local path must be a file:// url')
-
remote_url = url_util.parse(remote_path)
verify_ssl = spack.config.get('config:verify_ssl')