Merge lp:~mirantis/glance/body_file-fix into lp:~hudson-openstack/glance/trunk

Proposed by Yuriy Taraday
Status: Merged
Approved by: Brian Waldon
Approved revision: 143
Merged at revision: 145
Proposed branch: lp:~mirantis/glance/body_file-fix
Merge into: lp:~hudson-openstack/glance/trunk
Diff against target: 20 lines (+2/-1)
2 files modified
Authors (+1/-0)
glance/api/v1/images.py (+1/-1)
To merge this branch: bzr merge lp:~mirantis/glance/body_file-fix
Reviewer Review Type Date Requested Status
Brian Waldon (community) Approve
Jay Pipes (community) Approve
Review via email: mp+65670@code.launchpad.net

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Brian Waldon (bcwaldon) wrote :

Looks good, Yuriy.

review: Approve
Revision history for this message
Jay Pipes (jaypipes) wrote :

Excellent catch. :)

review: Approve
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (11.7 KiB)

The attempt to merge lp:~mirantis/glance/body_file-fix into lp:glance failed. Below is the output from the failed tests.

running test
running egg_info
creating glance.egg-info
writing glance.egg-info/PKG-INFO
writing top-level names to glance.egg-info/top_level.txt
writing dependency_links to glance.egg-info/dependency_links.txt
writing manifest file 'glance.egg-info/SOURCES.txt'
reading manifest file 'glance.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'ChangeLog'
writing manifest file 'glance.egg-info/SOURCES.txt'
running build_ext

We test the following: ... ok
We test the following: ... ok
Test for LP Bugs #736295, #767203 ... ok
We test conditions that produced LP Bug #768969, where an image ... ok
Set up three test images and ensure each query param filter works ... ok
We test the following sequential series of actions: ... ok
Ensure marker and limit query params work ... ok
We test the process flow where a user registers an image ... ok
A test against the actual datastore backend for the registry ... ok
A test that errors coming from the POST API do not ... ok
We test that various calls to the images and root endpoints are ... ok
We test the following sequential series of actions: ... ok
Test logging output proper when verbose and debug ... ok
Test logging output proper when verbose and debug ... ok
A test for LP bug #704854 -- Exception thrown by registry ... ok
Tests raises BadRequest for invalid store header ... ok
Tests to add a basic image in the file store ... ok
Tests creates a queued image for no body and no loc header ... ok
Tests creates a queued image for no body and no loc header ... ok
Test that the image contents are checksummed properly ... ok
test_bad_container_format (tests.unit.test_api.TestGlanceAPI) ... ok
test_bad_disk_format (tests.unit.test_api.TestGlanceAPI) ... ok
test_delete_image (tests.unit.test_api.TestGlanceAPI) ... ok
test_delete_non_exists_image (tests.unit.test_api.TestGlanceAPI) ... ok
Here, we try to delete an image that is in the queued state. ... ok
Test that the ETag header matches the x-image-meta-checksum ... ok
Test that the image contents are checksummed properly ... ok
Test for HEAD /images/<ID> ... ok
test_show_image_basic (tests.unit.test_api.TestGlanceAPI) ... ok
test_show_non_exists_image (tests.unit.test_api.TestGlanceAPI) ... ok
Tests that the /images POST registry API creates the image ... ok
Tests proper exception is raised if a bad disk_format is set ... ok
Tests proper exception is raised if a bad disk_format is set ... ok
Tests proper exception is raised if a bad status is set ... ok
Tests that exception raised for bad matching disk and container ... ok
Tests that the /images DELETE registry API deletes the image ... ok
Tests proper exception is raised if attempt to delete non-existing ... ok
Tests that the /images/detail registry API returns ... ok
Tests that the /images/detail registry API returns list of ... ok
Tests that the /images/detail registry API returns list of ... ok
Tests that the /images/detail registry API returns list of ... ok
Tests that the /images/detail registry API returns list of ... ok
Tests that the /images/d...

lp:~mirantis/glance/body_file-fix updated
143. By Yuriy Taraday

Add myself to Authors file.

Revision history for this message
Yuriy Taraday (yorik-sar) wrote :

Fixed.

Revision history for this message
Brian Waldon (bcwaldon) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Authors'
2--- Authors 2011-06-16 00:08:33 +0000
3+++ Authors 2011-06-27 05:20:30 +0000
4@@ -19,3 +19,4 @@
5 Taku Fukushima <tfukushima@dcl.info.waseda.ac.jp>
6 Thierry Carrez <thierry@openstack.org>
7 Vishvananda Ishaya <vishvananda@gmail.com>
8+Yuriy Taraday <yorik.sar@gmail.com>
9
10=== modified file 'glance/api/v1/images.py'
11--- glance/api/v1/images.py 2011-06-24 20:27:25 +0000
12+++ glance/api/v1/images.py 2011-06-27 05:20:30 +0000
13@@ -509,7 +509,7 @@
14 def _deserialize(self, request):
15 result = {}
16 result['image_meta'] = utils.get_image_meta_from_headers(request)
17- data = request.body if self.has_body(request) else None
18+ data = request.body_file if self.has_body(request) else None
19 result['image_data'] = data
20 return result
21

Subscribers

People subscribed via source and target branches