Various extensions don't respect content header when returning a 202

Bug #1356058 reported by Vish Ishaya
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Vish Ishaya

Bug Description

Various nova extensions commands return a text response ("202 Accepted [..]") even when provided with an "Accept: application/json" header. For other 202 responses, either an empty body or a JSON-formatted response is standard. The implementation should be consistent with other 202's from Nova and other OpenStack Services.

This seems to be due to returning a webob exception instead of a response. The affected extensions are:
$ grep HTTPAccepted nova/api/openstack/compute/contrib/*.py
nova/api/openstack/compute/contrib/cloudpipe_update.py: return webob.exc.HTTPAccepted()
nova/api/openstack/compute/contrib/fixed_ips.py: return webob.exc.HTTPAccepted()
nova/api/openstack/compute/contrib/networks_associate.py: return exc.HTTPAccepted()
nova/api/openstack/compute/contrib/networks_associate.py: return exc.HTTPAccepted()
nova/api/openstack/compute/contrib/networks_associate.py: return exc.HTTPAccepted()
nova/api/openstack/compute/contrib/os_networks.py: return exc.HTTPAccepted()
nova/api/openstack/compute/contrib/os_networks.py: return exc.HTTPAccepted()
nova/api/openstack/compute/contrib/os_tenant_networks.py: response = exc.HTTPAccepted()

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/113668

Changed in nova:
assignee: nobody → Vish Ishaya (vishvananda)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/113668
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=192d520a22155bd0a2553928da590e7ab8092292
Submitter: Jenkins
Branch: master

commit 192d520a22155bd0a2553928da590e7ab8092292
Author: Vishvananda Ishaya <email address hidden>
Date: Tue Aug 12 15:30:40 2014 -0700

    Fix 202 responses to contain valid content.

    Using a webob.exc to generate 202s makes the response return plain
    text in the body, which breaks things that expect to be able to
    parse data according to the content type. Using a webob.Response
    object makes sure the body of the 202 response is empty.

    Change-Id: Ifca3081f573407808a2196e71ac1db87180db6ec
    Resolves-bug: #1356058

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-3 → 2014.2
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.