nova host-list cann't return result in xml form

Bug #1075575 reported by Ivan-Zhu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Yaguang Tang

Bug Description

nova-api should can return result in json form and xml form. but the host-list api can only return result in json form.

It can be reproduced as the following step:

1)curl -i http://localhost:8774/v1.1/4ffc664c198e435e9853f2538fbcd7a7/os-hosts -X GET -H "X-Auth-Project-Id: admin" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: 0e48e3e8473f4aa18299d5c115bc4f5b"

return the following result:

{"hosts": [{"zone": "nova", "host_name": "host1", "service": "scheduler"}, {"zone": "nova", "host_name": "host1", "service": "compute"}, {"zone": "nova", "host_name": "host1", "service": "cert"}, {"zone": "nova", "host_name": "host1", "service": "network"}, {"zone": "nova", "host_name": "host1", "service": "consoleauth"}]}

but if we change "Accept: application/json" to "Accept: application/xml" and use the commang:

2)curl -i http://localhost:8774/v1.1/4ffc664c198e435e9853f2538fbcd7a7/os-hosts -X GET -H "X-Auth-Project-Id: admin" -H "User-Agent: python-novaclient" -H "Accept: application/xml" -H "X-Auth-Token: 0e48e3e8473f4aa18299d5c115bc4f5b"

it will be return the following result:

<?xml version='1.0' encoding='UTF-8'?>
<hosts><host/></hosts>

I think there is something wrong with @wsgi.serializers(xml=HostIndexTemplate) in the nova-api HostController.

Yaguang Tang (heut2008)
Changed in nova:
status: New → Confirmed
Yaguang Tang (heut2008)
Changed in nova:
assignee: nobody → Yaguang Tang (heut2008)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/15649

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/15649
Committed: http://github.com/openstack/nova/commit/a7e5180a04137c273777be0b6c50256c0ea3c0ae
Submitter: Jenkins
Branch: master

commit a7e5180a04137c273777be0b6c50256c0ea3c0ae
Author: Yaguang Tang <email address hidden>
Date: Fri Nov 9 01:43:05 2012 +0800

    Fix os-hosts extension can't return xml response correctly.

    Also add os-hosts integrated testing template files.
    fix bug 1075575
    fix bug 1070167.

    DocImpact

    Change-Id: I6b9f9e58e7cbe10a931d2c83d9baf9dcee74de08

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Changed in nova:
importance: Undecided → High
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-1 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.