summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaveed Massjouni <naveedm9@gmail.com>2011-06-01 23:37:51 -0400
committerNaveed Massjouni <naveedm9@gmail.com>2011-06-01 23:37:51 -0400
commit0e419c00ef9a463acc704f034e4c37929f0ef2eb (patch)
treedf112dfa2f813c86bac7306427556eee88c2b47b
parent16bd0ff62dccda5eba800b2762437d5e86faaafd (diff)
image href should be passed through the rebuild pipeline, not the image id.
-rw-r--r--nova/api/openstack/servers.py3
-rw-r--r--nova/compute/api.py6
2 files changed, 4 insertions, 5 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index 55fed408c..0ef1a83da 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -714,7 +714,6 @@ class ControllerV11(Controller):
LOG.debug(msg)
return faults.Fault(exc.HTTPBadRequest(explanation=msg))
- image_id = common.get_id_from_href(image_href)
personalities = info["rebuild"].get("personality", [])
metadata = info["rebuild"].get("metadata")
name = info["rebuild"].get("name")
@@ -724,7 +723,7 @@ class ControllerV11(Controller):
self._decode_personalities(personalities)
try:
- self.compute_api.rebuild(context, instance_id, image_id, name,
+ self.compute_api.rebuild(context, instance_id, image_href, name,
metadata, personalities)
except exception.BuildInProgress:
msg = _("Instance %d is currently being rebuilt.") % instance_id
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 2b353cebb..6a1c68561 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -529,8 +529,8 @@ class API(base.Base):
"""Reboot the given instance."""
self._cast_compute_message('reboot_instance', context, instance_id)
- def rebuild(self, context, instance_id, image_id, name=None, metadata=None,
- files_to_inject=None):
+ def rebuild(self, context, instance_id, image_href, name=None,
+ metadata=None, files_to_inject=None):
"""Rebuild the given instance with the provided metadata."""
instance = db.api.instance_get(context, instance_id)
@@ -550,7 +550,7 @@ class API(base.Base):
self.db.instance_update(context, instance_id, values)
rebuild_params = {
- "image_ref": image_ref,
+ "image_ref": image_href,
"injected_files": files_to_inject,
}