Fix bug 891738
Compute image size for the registry in the case where none is specified. Change-Id: Ic21adf4865d0f481db9bd362cfaeeebd0942c974
This commit is contained in:
parent
db10a10f55
commit
1f28b6ca7e
1
Authors
1
Authors
@ -24,6 +24,7 @@ Mark McLoughlin <markmc@redhat.com>
|
||||
Matt Dietz <matt.dietz@rackspace.com>
|
||||
Mike Lundy <mike@pistoncloud.com>
|
||||
Monty Taylor <mordred@inaugust.com>
|
||||
Paul Bourke <paul-david.bourke@hp.com>
|
||||
Rick Clark <rick@openstack.org>
|
||||
Rick Harris <rconradharris@gmail.com>
|
||||
Soren Hansen <soren.hansen@rackspace.com>
|
||||
|
@ -342,6 +342,13 @@ class Store(glance.store.base.Store):
|
||||
# best...
|
||||
obj_etag = swift_conn.put_object(self.container, obj_name,
|
||||
image_file)
|
||||
|
||||
if image_size == 0:
|
||||
resp_headers = swift_conn.head_object(self.container,
|
||||
obj_name)
|
||||
# header keys are lowercased by Swift
|
||||
if 'content-length' in resp_headers:
|
||||
image_size = int(resp_headers['content-length'])
|
||||
else:
|
||||
# Write the image into Swift in chunks. We cannot
|
||||
# stream chunks of the webob.Request.body_file, unfortunately,
|
||||
|
Loading…
x
Reference in New Issue
Block a user