From af2acabe35f91d0bdd2b2c921f23d6828e480a20 Mon Sep 17 00:00:00 2001 From: Brian Lamar Date: Wed, 9 Nov 2011 10:06:52 -0500 Subject: Converting rebuild to use instance objects. Related to blueprint internal-uuids Change-Id: If8a708a78ab017a4d807bf14542b3ab093d2e026 --- nova/compute/api.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/api.py b/nova/compute/api.py index 92e492390..79b9cc290 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1190,10 +1190,9 @@ class API(base.Base): params={'reboot_type': reboot_type}) @scheduler_api.reroute_compute("rebuild") - def rebuild(self, context, instance_id, image_href, admin_password, + def rebuild(self, context, instance, image_href, admin_password, name=None, metadata=None, files_to_inject=None): """Rebuild the given instance with the provided metadata.""" - instance = self.db.instance_get(context, instance_id) name = name or instance["display_name"] if instance["vm_state"] != vm_states.ACTIVE: @@ -1207,7 +1206,7 @@ class API(base.Base): self._check_metadata_properties_quota(context, metadata) self.update(context, - instance_id, + instance["id"], metadata=metadata, display_name=name, image_ref=image_href, @@ -1222,7 +1221,7 @@ class API(base.Base): self._cast_compute_message('rebuild_instance', context, - instance_id, + instance["id"], params=rebuild_params) @scheduler_api.reroute_compute("revert_resize") -- cgit