summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorDan Prince <dan.prince@rackspace.com>2011-08-04 11:11:12 -0400
committerDan Prince <dan.prince@rackspace.com>2011-08-04 11:11:12 -0400
commit4eed25b0f01b510d0d90e864eef7f285964ab293 (patch)
treea4256c8cbfc6ba5ebe8584c52d6926f854efe9dc /nova/api
parent9da88eac8fe728f506633f86ec6e75cf0212795b (diff)
The OSAPI v1.0 image create POST request should store the instance_id
as a Glance property.
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/images.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/nova/api/openstack/images.py b/nova/api/openstack/images.py
index 0834adfa5..c76738d30 100644
--- a/nova/api/openstack/images.py
+++ b/nova/api/openstack/images.py
@@ -116,13 +116,17 @@ class ControllerV10(Controller):
try:
image_name = image["name"]
- server_id = image["serverId"]
+ instance_id = image["serverId"]
except KeyError as missing_key:
msg = _("Image entity requires %s") % missing_key
raise webob.exc.HTTPBadRequest(explanation=msg)
context = req.environ["nova.context"]
- image = self._compute_service.snapshot(context, server_id, image_name)
+ props = {'instance_id': instance_id}
+ image = self._compute_service.snapshot(context,
+ instance_id,
+ image_name,
+ extra_properties=props)
return dict(image=self.get_builder(req).build(image, detail=True))