summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authormatt.dietz@rackspace.com <>2011-03-17 17:18:43 +0000
committerTarmac <>2011-03-17 17:18:43 +0000
commitaec13f3e7edb0425d89f3e779340b1f1b7bb2e36 (patch)
tree7e246f9488a2c82a762351236f8b3f4e4e20aa64 /nova/api
parent0a08d4728b8d209fd62f994539c982d8fbac3ce5 (diff)
parentf17fb9370d4af42267837a36c937f213669b0291 (diff)
Fixes lp736343 - Incorrect mapping of instance type id to flavor id in Openstack API
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/flavors.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/api/openstack/flavors.py b/nova/api/openstack/flavors.py
index f3d040ba3..1c440b3a9 100644
--- a/nova/api/openstack/flavors.py
+++ b/nova/api/openstack/flavors.py
@@ -36,7 +36,7 @@ class Controller(wsgi.Controller):
def index(self, req):
"""Return all flavors in brief."""
- return dict(flavors=[dict(id=flavor['id'], name=flavor['name'])
+ return dict(flavors=[dict(id=flavor['flavorid'], name=flavor['name'])
for flavor in self.detail(req)['flavors']])
def detail(self, req):
@@ -48,6 +48,7 @@ class Controller(wsgi.Controller):
"""Return data about the given flavor id."""
ctxt = req.environ['nova.context']
values = db.instance_type_get_by_flavor_id(ctxt, id)
+ values['id'] = values['flavorid']
return dict(flavor=values)
raise faults.Fault(exc.HTTPNotFound())