Fix backfill content checksums
This commit is contained in:
parent
c34399a217
commit
fa42693cdd
1 changed files with 1 additions and 2 deletions
|
@ -54,7 +54,6 @@ class ImageStoragePlacement(BaseModel):
|
||||||
location = ForeignKeyField(ImageStorageLocation)
|
location = ForeignKeyField(ImageStorageLocation)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_image_storage_locations(storage_id):
|
def _get_image_storage_locations(storage_id):
|
||||||
placements_query = (ImageStoragePlacement
|
placements_query = (ImageStoragePlacement
|
||||||
.select(ImageStoragePlacement, ImageStorageLocation)
|
.select(ImageStoragePlacement, ImageStorageLocation)
|
||||||
|
@ -91,7 +90,7 @@ def backfill_content_checksums():
|
||||||
with CloseForLongOperation(app.config):
|
with CloseForLongOperation(app.config):
|
||||||
try:
|
try:
|
||||||
# Compute the checksum
|
# Compute the checksum
|
||||||
layer_path = storage.image_layer_path(candidate_storage.uuid)
|
layer_path = storage.v1_image_layer_path(candidate_storage.uuid)
|
||||||
with storage.stream_read_file(locations, layer_path) as layer_data_handle:
|
with storage.stream_read_file(locations, layer_path) as layer_data_handle:
|
||||||
checksum = 'sha256:{0}'.format(checksums.sha256_file(layer_data_handle))
|
checksum = 'sha256:{0}'.format(checksums.sha256_file(layer_data_handle))
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
|
Reference in a new issue