diff options
| author | Brian Lamar <brian.lamar@rackspace.com> | 2011-11-09 10:06:52 -0500 |
|---|---|---|
| committer | Brian Lamar <brian.lamar@rackspace.com> | 2011-11-09 12:37:04 -0500 |
| commit | af2acabe35f91d0bdd2b2c921f23d6828e480a20 (patch) | |
| tree | ac02cc1f7b44de4e34afaaca8dbac6fe3665b118 /nova/compute | |
| parent | 00861098508fc675ba2d90a5c34fec152ddf5c3d (diff) | |
Converting rebuild to use instance objects.
Related to blueprint internal-uuids
Change-Id: If8a708a78ab017a4d807bf14542b3ab093d2e026
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 7 |
1 files changed, 3 insertions, 4 deletions
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") |
