* Converts dashes to underscores when extracting image-properties from HTTP headers (we already do this for 'regular' image attributes
* Update image_properties on image PUTs rather than trying to create dups
Bonus:
* Remove useless test_data file (no longer needed now that we can actually use Glance API via glance/client.py)
* Add glance_upload.py which we can use to add raw/extra-kernel images (this might be able to go away once we have a full-blown glance-admin tool. However, for now, this is useful for testing Glance <-> Nova integration.
using glance.client.Client.
This patch introduces chunked-transfer encoding to the client
classes. When the glance.client.BaseClient.do_request() method
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 :)
documentation.
The image's size is set to zero now during reservation of the image ID if the
image's size is not passed in with headers. In addition,
glance.store.Backend.add() now returns a tuple of (location, size) and
the image's size attribute in the registry is updated to this value if
previously set to zero.
Adds a new test case that ensures the size attribute is set properly
when not included in the image meta headers.
Adds documentation for the new _reserve(), _upload(), and _activate()
methods in glance.server.Controller.
This branch is Chris' work with a merge of trunk, fix of merge conflicts from trunk, and moving the import of boto into a conditional block so tests can run with the fakes when boto is not installed on the local machine.
The patch does the following:
* Image Create (POST) is broken up into 3 steps (reserve, upload and activate); reserve is used to allow the OpenStack API to return metadata about an image where the data has not been uploaded yet
* Image Update (PUT) now takes image data as the request body and metadata as headers (just like POST); state is enforced so that image data can only be uploaded once.
* Image statuses were changed to match the OpenStack API (queued, saving, active, killed); NOTE: preparing is not used
* update_image and add_image client calls now return metadata instead of just the id
/images request
Change the store API so that add takes a file-like object, not a string.
This avoids loading the whole request body into memory before writing it out,
and allows us to stream it instead.