From bb5fd5c56714a81a3bea84b4827af70eddc32b18 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Tue, 1 Jun 2021 09:10:32 +0200 Subject: Fix leading / during spack buildcache -f ... (#24028) For me the buildcache force overwrite option does not work. It tries to delete a file, but errors with a key error, apparently because the leading / has to be removed. --- lib/spack/spack/util/web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/spack/spack/util/web.py b/lib/spack/spack/util/web.py index f59f3bb064..90c7c2b8cc 100644 --- a/lib/spack/spack/util/web.py +++ b/lib/spack/spack/util/web.py @@ -277,7 +277,7 @@ def remove_url(url, recursive=False): r = s3.delete_objects(Bucket=bucket, Delete=delete_request) _debug_print_delete_results(r) else: - s3.delete_object(Bucket=bucket, Key=url.path) + s3.delete_object(Bucket=bucket, Key=url.path.lstrip('/')) return # Don't even try for other URL schemes. -- cgit v1.2.3-70-g09d2