From d851feef6e5559fd5a5b3e18ef5a7a7a8767967c Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Mon, 30 Jun 2014 14:51:01 -0400 Subject: [PATCH] One of the calls which returns an image was not using the base format which includes locations yet. --- data/model/legacy.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/data/model/legacy.py b/data/model/legacy.py index a6b79c594..e59cae6b9 100644 --- a/data/model/legacy.py +++ b/data/model/legacy.py @@ -1186,21 +1186,11 @@ def get_tag_image(namespace_name, repository_name, tag_name): def get_image_by_id(namespace_name, repository_name, docker_image_id): - query = (Image - .select(Image, ImageStorage) - .join(Repository) - .switch(Image) - .join(ImageStorage, JOIN_LEFT_OUTER) - .where(Repository.name == repository_name, - Repository.namespace == namespace_name, - Image.docker_image_id == docker_image_id)) - - try: - return query.get() - except Image.DoesNotExist: + image = get_repo_image(namespace_name, repository_name, docker_image_id) + if not image: raise DataModelException('Unable to find image \'%s\' for repo \'%s/%s\'' % - (docker_image_id, namespace_name, - repository_name)) + (docker_image_id, namespace_name, repository_name)) + return image def get_parent_images(namespace_name, repository_name, image_obj):