image href should be passed through the rebuild pipeline, not the image id.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user