From 75618ce6379cb01b9f78ddb7c2f26501b838ca71 Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Mon, 3 Jan 2011 19:32:25 -0800 Subject: dabo fix to update for password reset v2 --- nova/api/openstack/servers.py | 6 +++--- nova/compute/api.py | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 35c3324ab..a5de62230 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -176,9 +176,9 @@ class Controller(wsgi.Controller): try: ctxt = req.environ['nova.context'] - self.compute_api.update_instance(ctxt, - id, - **update_dict) + # The ID passed in is actually the internal_id of the + # instance, not the value of the id column in the DB. + self.compute_api.update_instance(ctxt, instance.id, **update_dict) except exception.NotFound: return faults.Fault(exc.HTTPNotFound()) return exc.HTTPNoContent() diff --git a/nova/compute/api.py b/nova/compute/api.py index fa9925627..edc8c0b4a 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -204,7 +204,7 @@ class ComputeAPI(base.Base): """Updates the instance in the datastore. :param context: The security context - :param instance_id: internal_id of the instance to update + :param instance_id: ID of the instance to update :param kwargs: All additional keyword args are treated as data fields of the instance to be updated @@ -212,8 +212,7 @@ class ComputeAPI(base.Base): :retval None """ - instance = self.get_instance(context, instance_id) - return self.db.instance_update(context, instance.id, kwargs) + return self.db.instance_update(context, instance_id, kwargs) def delete_instance(self, context, instance_id): logging.debug("Going to try and terminate %d" % instance_id) -- cgit