diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-01-18 07:54:33 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-01-18 07:54:33 +0000 |
| commit | d49d4b98f950b896ee9cfb9890b863d008f09a01 (patch) | |
| tree | 578e75c932a669688e410bf7ef86b6e92f49ad55 /nova/api | |
| parent | ad8843740154ebfa1e1be90413b9c5e973af9849 (diff) | |
| parent | 301bc0ca1a847f921c330dced1d4b1c82946ec55 (diff) | |
| download | nova-d49d4b98f950b896ee9cfb9890b863d008f09a01.tar.gz nova-d49d4b98f950b896ee9cfb9890b863d008f09a01.tar.xz nova-d49d4b98f950b896ee9cfb9890b863d008f09a01.zip | |
Merge "Set instance_ref property when creating snapshots."
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/admin_actions.py | 5 | ||||
| -rw-r--r-- | nova/api/openstack/compute/views/images.py | 8 |
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, |
