diff options
| author | Jenkins <jenkins@review.openstack.org> | 2011-11-09 20:22:22 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2011-11-09 20:22:22 +0000 |
| commit | cc3fe3f71da4f97d672e7acfb270913bf0940303 (patch) | |
| tree | d33c70dba8cb18cf14de4695a0abeab6d535cf5e /nova/api | |
| parent | 814cb1acc3237e7a31b85b43015e46c87231ead7 (diff) | |
| parent | af2acabe35f91d0bdd2b2c921f23d6828e480a20 (diff) | |
| download | nova-cc3fe3f71da4f97d672e7acfb270913bf0940303.tar.gz nova-cc3fe3f71da4f97d672e7acfb270913bf0940303.tar.xz nova-cc3fe3f71da4f97d672e7acfb270913bf0940303.zip | |
Merge "Converting rebuild to use instance objects."
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/servers.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 09bb96ce8..6a1c3497c 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -145,7 +145,7 @@ class Controller(object): def _get_server(self, context, instance_uuid): """Utility function for looking up an instance by uuid""" try: - return self.compute_api.get(context, instance_uuid) + return self.compute_api.routing_get(context, instance_uuid) except exception.NotFound: raise exc.HTTPNotFound() @@ -774,6 +774,7 @@ class Controller(object): def _action_rebuild(self, info, request, instance_id): context = request.environ['nova.context'] + instance = self._get_server(context, instance_id) try: image_href = info["rebuild"]["imageRef"] @@ -799,7 +800,7 @@ class Controller(object): password = utils.generate_password(FLAGS.password_length) try: - self.compute_api.rebuild(context, instance_id, image_href, + self.compute_api.rebuild(context, instance, image_href, password, name=name, metadata=metadata, files_to_inject=injected_files) except exception.RebuildRequiresActiveInstance: @@ -809,7 +810,7 @@ class Controller(object): msg = _("Instance %s could not be found") % instance_id raise exc.HTTPNotFound(explanation=msg) - instance = self.compute_api.routing_get(context, instance_id) + instance = self._get_server(context, instance_id) view = self._build_view(request, instance, is_detail=True) view['server']['adminPass'] = password |
