Switch image_data to be a file-like object instead of bare string in image creating and updating

Without this Glance loads all image into memory, then copies it one time, then writes it to temp file, and only after all this copies image to target repository.
This commit is contained in:
Yuriy Taraday 2011-06-27 14:37:40 +00:00 committed by Tarmac
commit 2ea83f6de8
2 changed files with 2 additions and 1 deletions

View File

@ -19,3 +19,4 @@ Soren Hansen <soren.hansen@rackspace.com>
Taku Fukushima <tfukushima@dcl.info.waseda.ac.jp>
Thierry Carrez <thierry@openstack.org>
Vishvananda Ishaya <vishvananda@gmail.com>
Yuriy Taraday <yorik.sar@gmail.com>

View File

@ -509,7 +509,7 @@ class ImageDeserializer(wsgi.JSONRequestDeserializer):
def _deserialize(self, request):
result = {}
result['image_meta'] = utils.get_image_meta_from_headers(request)
data = request.body if self.has_body(request) else None
data = request.body_file if self.has_body(request) else None
result['image_data'] = data
return result