Merge Rick's changes and correct small bug that was affecting test cases.

This commit is contained in:
jaypipes@gmail.com 2011-01-21 11:35:11 -05:00
commit 5bab765b4e
2 changed files with 3 additions and 12 deletions

View File

@ -216,8 +216,6 @@ class Client(BaseClient):
:retval Tuple containing (image_meta, image_blob)
:raises exception.NotFound if image is not found
"""
# TODO(jaypipes): Handle other registries than Registry...
res = self.do_request("GET", "/images/%s" % image_id)
image = util.get_image_meta_from_headers(res)
@ -250,19 +248,13 @@ class Client(BaseClient):
if image_meta is None:
image_meta = {}
if image_data:
body = image_data
else:
body = None
if not 'size' in image_meta.keys():
if body:
image_meta['size'] = len(body)
headers = util.image_meta_to_http_headers(image_meta)
if image_data:
body = image_data
headers['content-type'] = 'application/octet-stream'
else:
body = None
res = self.do_request("POST", "/images", body, headers)
data = json.loads(res.read())

View File

@ -323,7 +323,6 @@ class Controller(wsgi.Controller):
image data.
"""
image_meta = self._reserve(req)
if req.body:
self._upload_and_activate(req, image_meta)
else: