add "get_" prefix to all db read funcs
This commit is contained in:
parent
56951397a9
commit
b68e1b5efc
3 changed files with 7 additions and 7 deletions
|
@ -53,7 +53,7 @@ def delete_tag(namespace_name, repo_name, tag_name):
|
|||
return True
|
||||
|
||||
|
||||
def docker_v1_metadata_by_tag(namespace_name, repo_name, tag_name):
|
||||
def get_docker_v1_metadata_by_tag(namespace_name, repo_name, tag_name):
|
||||
if not repo_image:
|
||||
return None
|
||||
|
||||
|
@ -67,7 +67,7 @@ def docker_v1_metadata_by_tag(namespace_name, repo_name, tag_name):
|
|||
)
|
||||
|
||||
|
||||
def docker_v1_metadata_by_image_id(namespace_name, repo_name, image_ids):
|
||||
def get_docker_v1_metadata_by_image_id(namespace_name, repo_name, image_ids):
|
||||
images_query = model.image.lookup_repository_images(repo, all_image_ids)
|
||||
return {image.docker_image_id: DockerV1Metadata(namespace_name=namespace_name,
|
||||
repo_name=repo_name,
|
||||
|
@ -166,7 +166,7 @@ def create_blob_and_temp_tag(namespace_name, repo_name, expected_digest, upload_
|
|||
upload_obj.uncompressed_byte_count)
|
||||
|
||||
|
||||
def blob_by_digest(namespace_name, repo_name, digest):
|
||||
def get_blob_by_digest(namespace_name, repo_name, digest):
|
||||
try:
|
||||
return model.blob.get_repo_blob_by_digest(namespace_name, repo_name, digest)
|
||||
except model.BlobDoesNotExist:
|
||||
|
|
|
@ -41,7 +41,7 @@ class _InvalidRangeHeader(Exception):
|
|||
@cache_control(max_age=31436000)
|
||||
def check_blob_exists(namespace_name, repo_name, digest):
|
||||
# Find the blob.
|
||||
blob = v2.blob_by_digest(namespace_name, repo_name, digest)
|
||||
blob = v2.get_blob_by_digest(namespace_name, repo_name, digest)
|
||||
if blob is None:
|
||||
raise BlobUnknown()
|
||||
|
||||
|
@ -70,7 +70,7 @@ def check_blob_exists(namespace_name, repo_name, digest):
|
|||
@cache_control(max_age=31536000)
|
||||
def download_blob(namespace_name, repo_name, digest):
|
||||
# Find the blob.
|
||||
blob = v2.blob_by_digest(namespace_name, repo_name, digest)
|
||||
blob = v2.get_blob_by_digest(namespace_name, repo_name, digest)
|
||||
if blob is None:
|
||||
raise BlobUnknown()
|
||||
|
||||
|
|
|
@ -155,7 +155,7 @@ def _write_manifest(namespace_name, repo_name, manifest):
|
|||
# Lookup all the images and their parent images (if any) inside the manifest.
|
||||
# This will let us know which v1 images we need to synthesize and which ones are invalid.
|
||||
all_image_ids = list(manifest.docker_image_ids | manifest.parent_image_ids)
|
||||
images_map = v2.docker_v1_metadata_by_image_id(namespace_name, repo_name, all_image_ids)
|
||||
images_map = v2.get_docker_v1_metadata_by_image_id(namespace_name, repo_name, all_image_ids)
|
||||
|
||||
# Rewrite any v1 image IDs that do not match the checksum in the database.
|
||||
try:
|
||||
|
@ -228,7 +228,7 @@ def delete_manifest_by_digest(namespace_name, repo_name, digest):
|
|||
|
||||
def _generate_and_store_manifest(namespace_name, repo_name, tag_name):
|
||||
# Find the v1 metadata for this image and its parents.
|
||||
v1_metadata = v2.docker_v1_metadata_by_tag(namespace_name, repo_name, tag_name)
|
||||
v1_metadata = v2.get_docker_v1_metadata_by_tag(namespace_name, repo_name, tag_name)
|
||||
parents_v1_metadata = v2.get_parents_docker_v1_metadata(namespace_name, repo_name,
|
||||
v1_metadata.image_id)
|
||||
|
||||
|
|
Reference in a new issue