summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandy Walsh <sandy.walsh@rackspace.com>2011-01-03 19:32:25 -0800
committerSandy Walsh <sandy.walsh@rackspace.com>2011-01-03 19:32:25 -0800
commit75618ce6379cb01b9f78ddb7c2f26501b838ca71 (patch)
treed86d11e30d3a49dfe7a05bb520daba09036a6108
parent09b1844c012504e5b14d05e6178e35dfeb0c6579 (diff)
dabo fix to update for password reset v2
-rw-r--r--nova/api/openstack/servers.py6
-rw-r--r--nova/compute/api.py5
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)