placement needs to stop using accept.best_match from webob it is deprecated

Bug #1773225 reported by Chris Dent
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Chris Dent

Bug Description

Modern webob has improved its management of accept headers to be more in alignment with the HTTP RFCs (see bug https://bugs.launchpad.net/nova/+bug/1765748 ), deprecating their old handling:

DeprecationWarning: The behavior of AcceptValidHeader.best_match is currently being maintained for backward compatibility, but it will be deprecated in the future, as it does not conform to the RFC.

Eventually placement (in nova.api.openstack.placement.util:check_accept) should be updated to use the new way.

Creating a separate bug to be task oriented.

Tags: placement
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/575127

Changed in nova:
assignee: nobody → Chris Dent (cdent)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/575127
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=450444a7829506f5539bf25ecf6cee1c5d82c48d
Submitter: Zuul
Branch: master

commit 450444a7829506f5539bf25ecf6cee1c5d82c48d
Author: Chris Dent <email address hidden>
Date: Wed Jun 13 15:16:35 2018 +0100

    [placement] replace deprecated accept.best_match

    Webob has deprecated the best_match[1] method on accept headers and now
    spews warnings when it sees it.

    This change fixes it by using the equivalent (but more correct with
    regard to the relevant RFCs[2]) acceptable_offers[3] method.

    Existing unit tests in placement/test_util.py cover this change.

    [1] https://docs.pylonsproject.org/projects/webob/en/stable/api/webob.html#webob.acceptparse.AcceptValidHeader.best_match
    [2] https://tools.ietf.org/html/rfc7231#section-5.3.2
    [3] https://docs.pylonsproject.org/projects/webob/en/stable/api/webob.html#webob.acceptparse.AcceptValidHeader.acceptable_offers

    Change-Id: Ie4d81fa178b3ed6b2a7b450b4978009486f07810
    Closes-Bug: #1773225

Changed in nova:
status: In Progress → Fix Released
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/579110

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/579110
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=c4e0ad14333f00e464826921d8b7a7e53e2c30c9
Submitter: Zuul
Branch: master

commit c4e0ad14333f00e464826921d8b7a7e53e2c30c9
Author: Sylvain Bauza <email address hidden>
Date: Fri Jun 29 11:44:23 2018 +0200

    Fix placement incompatible with webob 1.7

    In Ie4d81fa178b3ed6b2a7b450b4978009486f07810 we started using a new WebOb API
    for introspecting headers but since this new API isn't supported by older
    versions than 1.8, we need to only accept 1.8.1 or 1.8.2 for Nova
    (because 1.8.0 was having a bug fixed by 1.8.1 at least).

    Change-Id: I345f372815aef5ac0fb6fc607812ce81587734bf
    Closes-Bug: #1773225

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 18.0.0.0b3

This issue was fixed in the openstack/nova 18.0.0.0b3 development milestone.

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.