Merge "Fix v2 data upload to swift"
This commit is contained in:
commit
df7d9c7171
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue