Merge "Fix v2 data upload to swift"

This commit is contained in:
Jenkins 2013-03-07 18:51:38 +00:00 committed by Gerrit Code Review
commit df7d9c7171
2 changed files with 2 additions and 2 deletions

View File

@ -376,7 +376,7 @@ class ImageProxy(glance.domain.proxy.Image):
size = 0 # NOTE(markwash): zero -> unknown size
location, size, checksum = self.store_api.add_to_backend(
self.context, CONF.default_store,
self.image.image_id, data, size)
self.image.image_id, utils.CooperativeReader(data), size)
self.image.locations = [location]
self.image.size = size
self.image.checksum = checksum

View File

@ -129,7 +129,7 @@ class FakeStoreAPI(object):
if image_id in location:
raise exception.Duplicate()
if not size:
size = len(data)
size = len(data.fd)
if (current_store_size + size) > store_max_size:
raise exception.StorageFull()
if context.user == USER2: