summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorDan Prince <dan.prince@rackspace.com>2012-01-17 16:00:20 -0500
committerDan Prince <dan.prince@rackspace.com>2012-01-17 21:15:09 -0500
commit301bc0ca1a847f921c330dced1d4b1c82946ec55 (patch)
tree368843e93e19eba925ab87bea687eda2433cf930 /nova/api
parent7bb9f3413a2bc6ef56ab3c384d0624f193e58e34 (diff)
Set instance_ref property when creating snapshots.
Fixes LP bug #917810. Change-Id: I17c1e467a13075f3952dc6a1b475bc71a8b1d9bc
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/contrib/admin_actions.py5
-rw-r--r--nova/api/openstack/compute/views/images.py8
2 files changed, 6 insertions, 7 deletions
diff --git a/nova/api/openstack/compute/contrib/admin_actions.py b/nova/api/openstack/compute/contrib/admin_actions.py
index a4164fcb8..b44f16a1e 100644
--- a/nova/api/openstack/compute/contrib/admin_actions.py
+++ b/nova/api/openstack/compute/contrib/admin_actions.py
@@ -232,10 +232,7 @@ class AdminActionsController(wsgi.Controller):
msg = _("createBackup attribute 'rotation' must be an integer")
raise exc.HTTPBadRequest(explanation=msg)
- # preserve link to server in image properties
- server_ref = os.path.join(req.application_url, 'servers', id)
- props = {'instance_ref': server_ref}
-
+ props = {}
metadata = entity.get('metadata', {})
common.check_img_metadata_quota_limit(context, metadata)
try:
diff --git a/nova/api/openstack/compute/views/images.py b/nova/api/openstack/compute/views/images.py
index c4cfe8031..5ef1af59b 100644
--- a/nova/api/openstack/compute/views/images.py
+++ b/nova/api/openstack/compute/views/images.py
@@ -50,11 +50,13 @@ class ViewBuilder(common.ViewBuilder):
"links": self._get_links(request, image["id"]),
}
- server_ref = image.get("properties", {}).get("instance_ref")
+ instance_uuid = image.get("properties", {}).get("instance_uuid")
- if server_ref is not None:
+ if instance_uuid is not None:
+ server_ref = os.path.join(request.application_url, 'servers',
+ instance_uuid)
image_dict["server"] = {
- "id": common.get_id_from_href(server_ref),
+ "id": instance_uuid,
"links": [{
"rel": "self",
"href": server_ref,