From 1dba0cdc332e54162dc1d880e80deca968dbff4e Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Thu, 10 Nov 2011 23:36:17 -0500 Subject: Convert remaining calls to use instance objects Related to blueprint internal-uuids. This touches get_diagnostics, get_actions, and restore. Change-Id: Ic4b3d9476fb53cb97b4ea75ad2e846374b2b4a41 --- nova/api/openstack/contrib/deferred_delete.py | 3 ++- nova/api/openstack/servers.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/contrib/deferred_delete.py b/nova/api/openstack/contrib/deferred_delete.py index 013acbbea..8415ca4b3 100644 --- a/nova/api/openstack/contrib/deferred_delete.py +++ b/nova/api/openstack/contrib/deferred_delete.py @@ -42,7 +42,8 @@ class Deferred_delete(extensions.ExtensionDescriptor): """Restore a previously deleted instance.""" context = req.environ["nova.context"] - self.compute_api.restore(context, instance_id) + instance = self.compute_api.get(context, instance_id) + self.compute_api.restore(context, instance) return webob.Response(status_int=202) def _force_delete(self, input_dict, req, instance_id): diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 1e9089560..677635354 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -646,12 +646,14 @@ class Controller(object): def diagnostics(self, req, id): """Permit Admins to retrieve server diagnostics.""" ctxt = req.environ["nova.context"] - return self.compute_api.get_diagnostics(ctxt, id) + instance = self._get_server(ctxt, id) + return self.compute_api.get_diagnostics(ctxt, instance) def actions(self, req, id): """Permit Admins to retrieve server actions.""" ctxt = req.environ["nova.context"] - items = self.compute_api.get_actions(ctxt, id) + instance = self._get_server(ctxt, id) + items = self.compute_api.get_actions(ctxt, instance) actions = [] # TODO(jk0): Do not do pre-serialization here once the default # serializer is updated -- cgit