summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-10-04 22:54:26 +0000
committerGerrit Code Review <review@openstack.org>2012-10-04 22:54:26 +0000
commitcbd850ca3ad2b42c240530711c4e7755e7aa2ecf (patch)
treecf6b8c6574946ba2cb8c2a92ed5adf5ceeeb3b94 /nova/api
parent73e0642f0d3f48b152d5d7183bfa5b49a6cea67c (diff)
parent903b51e148c2f9e858b5ea0ca5b230ac308d76c5 (diff)
downloadnova-cbd850ca3ad2b42c240530711c4e7755e7aa2ecf.tar.gz
nova-cbd850ca3ad2b42c240530711c4e7755e7aa2ecf.tar.xz
nova-cbd850ca3ad2b42c240530711c4e7755e7aa2ecf.zip
Merge "Fix XML response for return_reservation_id."
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/servers.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py
index 07731e3ba..89eac8bfd 100644
--- a/nova/api/openstack/compute/servers.py
+++ b/nova/api/openstack/compute/servers.py
@@ -66,6 +66,7 @@ def make_server(elem, detailed=False):
elem.set('accessIPv6')
elem.set('status')
elem.set('progress')
+ elem.set('reservation_id')
# Attach image node
image = xmlutil.SubTemplateElement(elem, 'image', selector='image')
@@ -889,7 +890,13 @@ class Controller(wsgi.Controller):
# Let the caller deal with unhandled exceptions.
# If the caller wanted a reservation_id, return it
- if ret_resv_id:
+
+ # NOTE(treinish): XML serialization will not work without a root
+ # selector of 'server' however JSON return is not expecting a server
+ # field/object
+ if ret_resv_id and (req.get_content_type() == 'application/xml'):
+ return {'server': {'reservation_id': resv_id}}
+ elif ret_resv_id:
return {'reservation_id': resv_id}
req.cache_db_instances(instances)