summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorBrian Lamar <brian.lamar@rackspace.com>2011-11-09 10:06:52 -0500
committerBrian Lamar <brian.lamar@rackspace.com>2011-11-09 12:37:04 -0500
commitaf2acabe35f91d0bdd2b2c921f23d6828e480a20 (patch)
treeac02cc1f7b44de4e34afaaca8dbac6fe3665b118 /nova/api
parent00861098508fc675ba2d90a5c34fec152ddf5c3d (diff)
downloadnova-af2acabe35f91d0bdd2b2c921f23d6828e480a20.tar.gz
nova-af2acabe35f91d0bdd2b2c921f23d6828e480a20.tar.xz
nova-af2acabe35f91d0bdd2b2c921f23d6828e480a20.zip
Converting rebuild to use instance objects.
Related to blueprint internal-uuids Change-Id: If8a708a78ab017a4d807bf14542b3ab093d2e026
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/servers.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index 2a1424e46..125718114 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()
@@ -769,6 +769,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"]
@@ -794,7 +795,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:
@@ -804,7 +805,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