Move shared V1/V2 code into common methods and fix verbs
This commit is contained in:
parent
0e93dbb832
commit
d246e68e68
5 changed files with 42 additions and 28 deletions
|
@ -216,3 +216,14 @@ def get_repo_storage_by_checksum(namespace, repository_name, checksum):
|
|||
return _get_storage(filter_to_repo_and_checksum)
|
||||
except InvalidImageException:
|
||||
raise InvalidImageException('No storage found with checksum {0}'.format(checksum))
|
||||
|
||||
|
||||
def get_layer_path(storage_record, store):
|
||||
""" Returns the path in the storage engine to the layer data referenced by the storage row. """
|
||||
if not storage_record.cas_path:
|
||||
return store.v1_image_layer_path(storage_record.uuid)
|
||||
|
||||
return store.blob_path(storage_record.checksum)
|
||||
|
||||
|
||||
|
||||
|
|
Reference in a new issue