PUTing and POSTing using image key

This commit is contained in:
Rick Harris 2010-10-17 11:31:04 -05:00
parent 86ed432790
commit 9382efb849
2 changed files with 6 additions and 6 deletions

View File

@ -96,7 +96,7 @@ class ImageController(wsgi.Controller):
in the 'id' field
"""
image_data = json.loads(req.body)
image_data = json.loads(req.body)['image']
# Ensure the image has a status set
image_data.setdefault('status', 'available')
@ -116,7 +116,7 @@ class ImageController(wsgi.Controller):
:retval Returns the updated image information as a mapping,
"""
image_data = json.loads(req.body)
image_data = json.loads(req.body)['image']
context = None
updated_image = db.image_update(context, id, image_data)

View File

@ -105,7 +105,7 @@ class TestImageController(unittest.TestCase):
req = webob.Request.blank('/images')
req.method = 'POST'
req.body = json.dumps(fixture)
req.body = json.dumps(dict(image=fixture))
res = req.get_response(controllers.API())
@ -134,7 +134,7 @@ class TestImageController(unittest.TestCase):
req = webob.Request.blank('/images')
req.method = 'POST'
req.body = json.dumps(fixture)
req.body = json.dumps(dict(image=fixture))
# TODO(jaypipes): Port Nova's Fault infrastructure
# over to Glance to support exception catching into
@ -150,7 +150,7 @@ class TestImageController(unittest.TestCase):
req = webob.Request.blank('/images/2')
req.method = 'PUT'
req.body = json.dumps(fixture)
req.body = json.dumps(dict(image=fixture))
res = req.get_response(controllers.API())
@ -174,7 +174,7 @@ class TestImageController(unittest.TestCase):
req = webob.Request.blank('/images/3')
req.method = 'PUT'
req.body = json.dumps(fixture)
req.body = json.dumps(dict(image=fixture))
# TODO(jaypipes): Port Nova's Fault infrastructure
# over to Glance to support exception catching into