From b99a5b65f75cfd899ee6c4024f7af6242887c093 Mon Sep 17 00:00:00 2001 From: François Charlier Date: Tue, 10 Jan 2012 16:58:47 +0100 Subject: Fix call to compute_api.resize from _migrate _migrate called compute_api.resize with an instance id, compute_api.resize expects an instance object. Change-Id: I0ab9ac48f8d7b4d5d92e0212969cc8febc5cf82b --- nova/api/openstack/v2/contrib/admin_actions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/openstack/v2/contrib/admin_actions.py b/nova/api/openstack/v2/contrib/admin_actions.py index 2120462b9..f4207354c 100644 --- a/nova/api/openstack/v2/contrib/admin_actions.py +++ b/nova/api/openstack/v2/contrib/admin_actions.py @@ -108,8 +108,10 @@ class Admin_actions(extensions.ExtensionDescriptor): @scheduler_api.redirect_handler def _migrate(self, input_dict, req, id): """Permit admins to migrate a server to a new host""" + context = req.environ['nova.context'] try: - self.compute_api.resize(req.environ['nova.context'], id) + instance = self.compute_api.get(context, id) + self.compute_api.resize(req.environ['nova.context'], instance) except Exception, e: LOG.exception(_("Error in migrate %s"), e) raise exc.HTTPBadRequest() -- cgit