Merge pull request #491 from jakedt/migratebackp2

Migrate image data back phase 2
This commit is contained in:
josephschorr 2015-09-26 15:11:46 -04:00
commit 7ad2522dbe
11 changed files with 232 additions and 66 deletions

View file

@ -12,11 +12,7 @@ from util.cache import cache_control_flask_restful
def image_view(image, image_map, include_ancestors=True):
extended_props = image
if image.storage and image.storage.id:
extended_props = image.storage
command = extended_props.command
command = image.command
def docker_id(aid):
if not aid or not aid in image_map:
@ -26,10 +22,10 @@ def image_view(image, image_map, include_ancestors=True):
image_data = {
'id': image.docker_image_id,
'created': format_date(extended_props.created),
'comment': extended_props.comment,
'created': format_date(image.created),
'comment': image.comment,
'command': json.loads(command) if command else None,
'size': extended_props.image_size,
'size': image.storage.image_size,
'uploading': image.storage.uploading,
'sort_index': len(image.ancestors),
}

View file

@ -248,7 +248,7 @@ class Repository(RepositoryParamResource):
tag_info = {
'name': tag.name,
'image_id': tag.image.docker_image_id,
'size': tag.image.storage.aggregate_size
'size': tag.image.aggregate_size
}
if tag.lifetime_start_ts > 0: