summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2011-09-02 12:52:02 -0700
committerVishvananda Ishaya <vishvananda@gmail.com>2011-09-02 12:52:02 -0700
commitcc3bd1da5edc368871d2c8de0e498ab2649ae0dd (patch)
tree6b45106f9f16b0e1d2323d8863693df653d50adc /nova/api
parente5527e712c17baa0b526cdd8dd04f6c4a7434b82 (diff)
downloadnova-cc3bd1da5edc368871d2c8de0e498ab2649ae0dd.tar.gz
nova-cc3bd1da5edc368871d2c8de0e498ab2649ae0dd.tar.xz
nova-cc3bd1da5edc368871d2c8de0e498ab2649ae0dd.zip
revert description changes, use metadata['description'] if it is set to populate field in db
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/create_instance_helper.py9
-rw-r--r--nova/api/openstack/schemas/v1.1/server.rng1
-rw-r--r--nova/api/openstack/servers.py6
-rw-r--r--nova/api/openstack/views/servers.py1
4 files changed, 7 insertions, 10 deletions
diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py
index ff3be4a01..289f87921 100644
--- a/nova/api/openstack/create_instance_helper.py
+++ b/nova/api/openstack/create_instance_helper.py
@@ -161,6 +161,10 @@ class CreateInstanceHelper(object):
'config_drive': config_drive,
'password': password}
+ # NOTE(vish): This is solely for compatibility with anything
+ # that is using the display description field.
+ metadata = server_dict.get('metadata') or {}
+ display_description = metadata.get('description') or ''
return (extra_values,
create_method(context,
inst_type,
@@ -168,10 +172,9 @@ class CreateInstanceHelper(object):
kernel_id=kernel_id,
ramdisk_id=ramdisk_id,
display_name=name,
- display_description=server_dict.\
- get('description', ''),
+ display_description=display_description,
key_name=key_name,
- metadata=server_dict.get('metadata', {}),
+ metadata=metadata,
access_ip_v4=server_dict.get('accessIPv4'),
access_ip_v6=server_dict.get('accessIPv6'),
injected_files=injected_files,
diff --git a/nova/api/openstack/schemas/v1.1/server.rng b/nova/api/openstack/schemas/v1.1/server.rng
index 203728f48..ef835e408 100644
--- a/nova/api/openstack/schemas/v1.1/server.rng
+++ b/nova/api/openstack/schemas/v1.1/server.rng
@@ -3,7 +3,6 @@
<attribute name="name"> <text/> </attribute>
<attribute name="userId"> <text/> </attribute>
<attribute name="tenantId"> <text/> </attribute>
- <attribute name="description"> <text/> </attribute>
<attribute name="id"> <text/> </attribute>
<attribute name="uuid"> <text/> </attribute>
<attribute name="updated"> <text/> </attribute>
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index 7f5463e70..46a111cf5 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -185,9 +185,6 @@ class Controller(object):
self.helper._validate_server_name(name)
update_dict['display_name'] = name.strip()
- if 'description' in body['server']:
- description = body['server']['description']
- update_dict['display_description'] = description.strip()
if 'accessIPv4' in body['server']:
access_ipv4 = body['server']['accessIPv4']
update_dict['access_ip_v4'] = access_ipv4.strip()
@@ -881,7 +878,6 @@ class ServerXMLSerializer(wsgi.XMLDictSerializer):
node.setAttribute('uuid', str(server['uuid']))
node.setAttribute('hostId', str(server['hostId']))
node.setAttribute('name', server['name'])
- node.setAttribute('description', server['description'])
node.setAttribute('created', str(server['created']))
node.setAttribute('updated', str(server['updated']))
node.setAttribute('status', server['status'])
@@ -997,7 +993,7 @@ def create_resource(version='1.0'):
"attributes": {
"server": ["id", "imageId", "name", "flavorId", "hostId",
"status", "progress", "adminPass", "flavorRef",
- "imageRef", "userId", "tenantId", "description"],
+ "imageRef", "userId", "tenantId"],
"link": ["rel", "type", "href"],
},
"dict_collections": {
diff --git a/nova/api/openstack/views/servers.py b/nova/api/openstack/views/servers.py
index 98ccd817a..ac09b5864 100644
--- a/nova/api/openstack/views/servers.py
+++ b/nova/api/openstack/views/servers.py
@@ -68,7 +68,6 @@ class ViewBuilder(object):
'name': inst['display_name'],
'user_id': inst.get('user_id', ''),
'tenant_id': inst.get('project_id', ''),
- 'description': inst.get('display_description', ''),
'status': common.status_from_state(vm_state, task_state)}
# Return the metadata as a dictionary