Refactor security worker

This commit is contained in:
Quentin Machu 2015-11-17 17:42:52 -05:00
parent 206ffc65af
commit 605ed1fc77
6 changed files with 184 additions and 182 deletions

View file

@ -225,3 +225,13 @@ def lookup_repo_storages_by_content_checksum(repo, checksums):
.select()
.join(Image)
.where(Image.repository == repo, ImageStorage.content_checksum << checksums))
def get_storage_locations(uuid):
query = (ImageStoragePlacement
.select()
.join(ImageStorageLocation)
.switch(ImageStoragePlacement)
.join(ImageStorage, JOIN_LEFT_OUTER)
.where(ImageStorage.uuid == uuid))
return [location.location.name for location in query]