summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorMichael Gundlach <michael.gundlach@rackspace.com>2010-12-01 22:14:29 +0000
committerTarmac <>2010-12-01 22:14:29 +0000
commitf8afbcc08b65d4d6764a6dc66c804816573ab3b4 (patch)
tree8dd8b1cb664626932d56e044303535773f0d84bc /nova/api
parent225fd37fb234740c814410b3e4d3149212cf54c5 (diff)
parent8af2b1c97903f11034a95894a23bb7e77f573aa6 (diff)
Guarantee that the OpenStack API's Server-related responses will always contain a "name" value. And get rid of a redundant field in models.py.
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/servers.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index 1d8aa2fa4..44e69b82c 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -63,7 +63,7 @@ def _entity_detail(inst):
inst_dict = {}
mapped_keys = dict(status='state', imageId='image_id',
- flavorId='instance_type', name='server_name', id='id')
+ flavorId='instance_type', name='display_name', id='id')
for k, v in mapped_keys.iteritems():
inst_dict[k] = inst[v]
@@ -78,7 +78,7 @@ def _entity_detail(inst):
def _entity_inst(inst):
""" Filters all model attributes save for id and name """
- return dict(server=dict(id=inst['id'], name=inst['server_name']))
+ return dict(server=dict(id=inst['id'], name=inst['display_name']))
class Controller(wsgi.Controller):
@@ -213,7 +213,6 @@ class Controller(wsgi.Controller):
if not image:
raise Exception("Image not found")
- inst['server_name'] = env['server']['name']
inst['image_id'] = image_id
inst['user_id'] = user_id
inst['launch_time'] = ltime