Fix the size calculation to prefer the shared version if both are available.

This commit is contained in:
Jake Moshenko 2014-06-10 15:34:32 -04:00
parent eb69588270
commit 4b13ddc118

View file

@ -307,7 +307,7 @@ def get_image_json(namespace, repository, image_id, headers):
profile.debug('Looking up repo layer size')
try:
size = repo_image.image_size or repo_image.storage.image_size
size = (repo_image.storage and repo_image.storage.image_size) or repo_image.image_size
headers['X-Docker-Size'] = str(size)
except OSError:
pass