PUTing and POSTing using image key
This commit is contained in:
parent
86ed432790
commit
9382efb849
@ -96,7 +96,7 @@ class ImageController(wsgi.Controller):
|
|||||||
in the 'id' field
|
in the 'id' field
|
||||||
|
|
||||||
"""
|
"""
|
||||||
image_data = json.loads(req.body)
|
image_data = json.loads(req.body)['image']
|
||||||
|
|
||||||
# Ensure the image has a status set
|
# Ensure the image has a status set
|
||||||
image_data.setdefault('status', 'available')
|
image_data.setdefault('status', 'available')
|
||||||
@ -116,7 +116,7 @@ class ImageController(wsgi.Controller):
|
|||||||
:retval Returns the updated image information as a mapping,
|
:retval Returns the updated image information as a mapping,
|
||||||
|
|
||||||
"""
|
"""
|
||||||
image_data = json.loads(req.body)
|
image_data = json.loads(req.body)['image']
|
||||||
|
|
||||||
context = None
|
context = None
|
||||||
updated_image = db.image_update(context, id, image_data)
|
updated_image = db.image_update(context, id, image_data)
|
||||||
|
@ -105,7 +105,7 @@ class TestImageController(unittest.TestCase):
|
|||||||
req = webob.Request.blank('/images')
|
req = webob.Request.blank('/images')
|
||||||
|
|
||||||
req.method = 'POST'
|
req.method = 'POST'
|
||||||
req.body = json.dumps(fixture)
|
req.body = json.dumps(dict(image=fixture))
|
||||||
|
|
||||||
res = req.get_response(controllers.API())
|
res = req.get_response(controllers.API())
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ class TestImageController(unittest.TestCase):
|
|||||||
req = webob.Request.blank('/images')
|
req = webob.Request.blank('/images')
|
||||||
|
|
||||||
req.method = 'POST'
|
req.method = 'POST'
|
||||||
req.body = json.dumps(fixture)
|
req.body = json.dumps(dict(image=fixture))
|
||||||
|
|
||||||
# TODO(jaypipes): Port Nova's Fault infrastructure
|
# TODO(jaypipes): Port Nova's Fault infrastructure
|
||||||
# over to Glance to support exception catching into
|
# over to Glance to support exception catching into
|
||||||
@ -150,7 +150,7 @@ class TestImageController(unittest.TestCase):
|
|||||||
req = webob.Request.blank('/images/2')
|
req = webob.Request.blank('/images/2')
|
||||||
|
|
||||||
req.method = 'PUT'
|
req.method = 'PUT'
|
||||||
req.body = json.dumps(fixture)
|
req.body = json.dumps(dict(image=fixture))
|
||||||
|
|
||||||
res = req.get_response(controllers.API())
|
res = req.get_response(controllers.API())
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ class TestImageController(unittest.TestCase):
|
|||||||
req = webob.Request.blank('/images/3')
|
req = webob.Request.blank('/images/3')
|
||||||
|
|
||||||
req.method = 'PUT'
|
req.method = 'PUT'
|
||||||
req.body = json.dumps(fixture)
|
req.body = json.dumps(dict(image=fixture))
|
||||||
|
|
||||||
# TODO(jaypipes): Port Nova's Fault infrastructure
|
# TODO(jaypipes): Port Nova's Fault infrastructure
|
||||||
# over to Glance to support exception catching into
|
# over to Glance to support exception catching into
|
||||||
|
Loading…
x
Reference in New Issue
Block a user