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.
This commit is contained in:
Harmen Stoppels 2021-06-01 09:10:32 +02:00 committed by GitHub
parent 40803365f3
commit bb5fd5c567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.