Fix s3 delete.
This commit is contained in:
parent
f1e85bdcba
commit
cbe0590ce5
3 changed files with 4 additions and 4 deletions
|
@ -11,7 +11,7 @@ from util.gravatar import compute_hash
|
|||
from auth.permissions import (ReadRepositoryPermission,
|
||||
ModifyRepositoryPermission,
|
||||
AdministerRepositoryPermission)
|
||||
from endpoints.registry import delete_registry_storage
|
||||
from endpoints import registry
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -146,7 +146,7 @@ def delete_repository(namespace, repository):
|
|||
permission = AdministerRepositoryPermission(namespace, repository)
|
||||
if permission.can():
|
||||
model.purge_repository(namespace, repository)
|
||||
delete_registry_storage(namespace, repository)
|
||||
registry.delete_repository_storage(namespace, repository)
|
||||
return make_response('Deleted', 204)
|
||||
|
||||
abort(404)
|
||||
|
|
|
@ -304,7 +304,7 @@ def put_image_json(namespace, repository, image_id):
|
|||
return make_response('true', 200)
|
||||
|
||||
|
||||
def delete_registry_storage(namespace, repository):
|
||||
def delete_repository_storage(namespace, repository):
|
||||
""" Caller should have already verified proper permissions. """
|
||||
repository_path = store.repository_namespace_path(namespace, repository)
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ class S3Storage(Storage):
|
|||
# We assume it's a directory
|
||||
if not path.endswith('/'):
|
||||
path += '/'
|
||||
for key in self._s3_bucket.list(prefix=path, delimiter='/'):
|
||||
for key in self._s3_bucket.list(prefix=path):
|
||||
key.delete()
|
||||
|
||||
def get_size(self, path):
|
||||
|
|
Reference in a new issue