Merge lp:~jaypipes/glance/bug700162 into lp:~hudson-openstack/glance/trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Devin Carlen | ||||
Approved revision: | 46 | ||||
Merged at revision: | 44 | ||||
Proposed branch: | lp:~jaypipes/glance/bug700162 | ||||
Merge into: | lp:~hudson-openstack/glance/trunk | ||||
Prerequisite: | lp:~jaypipes/glance/bug705583 | ||||
Diff against target: |
134 lines (+54/-18) 3 files modified
glance/client.py (+35/-17) glance/server.py (+3/-1) tests/stubs.py (+16/-0) |
||||
To merge this branch: | bzr merge lp:~jaypipes/glance/bug700162 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Devin Carlen (community) | Approve | ||
Rick Harris (community) | Approve | ||
Soren Hansen | Pending | ||
Ewan Mellor | Pending | ||
Review via email: mp+46969@code.launchpad.net |
Commit message
Fixes LP Bug #700162: Images greater than 2GB cannot be uploaded
using glance.
Description of the change
Fixes LP Bug #700162: Images greater than 2GB cannot be uploaded
using glance.
This patch introduces chunked-transfer encoding to the client
classes. When the glance.
is called and the method is either POST or PUT and the body
argument is a file-like object, then the do_request() method
builds a chunked-transfer encoded request and send()s chunks of
the body file-like object over the httplib connection.
Not sure how we fully test this, since we'd have to pack up
a very large file for use in testing, but I'm open to suggestions :)
Perfect timing, hit this bug just now and there is already a patch :)
Overall, your fix looks really good. I had to make a couple of small tweaks to get it fully-working. My fixes are here:
https:/ /code.launchpad .net/~rconradha rris/glance/ bug700162
> Not sure how we fully test this, since we'd have to pack up
> a very large file for use in testing, but I'm open to suggestion
I just tested the code functionally by uploading ubuntu-lucid into Glance. Without the fix I get a MemoryError, with it, it uploads successfully.