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

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.