Comment 9 for bug 1765748

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

Reviewed: https://review.openstack.org/564883
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=73cc41c9ceb4e38b60ea22402524bae49aa41c32
Submitter: Zuul
Branch: master

commit 73cc41c9ceb4e38b60ea22402524bae49aa41c32
Author: Brian Rosmaita <email address hidden>
Date: Fri Apr 27 16:46:14 2018 -0400

    Prepare for WebOb 1.8.1

    WebOb 1.8.1 removes a function (deprecated for a long time) that
    Glance uses for negotiating 'Accept-Language' headers. The removed
    function is replaced by a function that implements the "Lookup"
    scheme defined in RFC 4647.

    Glance wraps the webob.Request object and provides a convenience
    method around the old function. This patch uses the new webob
    function in the convenience method and wraps it in such a way that
    the convenience method preserves its current behavior (at least with
    respect to the Glance tests). But ... "Lookup" is compliant with RFC
    7231, whereas the old function was not. This means that given
    sufficiently complex Accept-Language header values (containing
    q-values), the best match under webob 1.8.1 will be different from
    the best match under webob 1.7.x. Given that the best match will,
    however, be RFC 7231 compliant, this is an acceptable change.

    One further complication is that the lookup() function is not
    available in webob 1.7.x. Thus this patch handles both versions. I
    suggest that as soon as WebOb===1.8.1 is merged into
    lower_constraints, the code be simplified to handle 1.8.x only, and
    the following release note be submitted with that patch:

    Negotiation of the 'Accept-Language' header now follows the "Lookup"
    matching scheme described in `RFC 4647, section 3.4
    <https://tools.ietf.org/html/rfc4647.html#section-3.4>`_. The
    "Lookup" scheme is one of the algorithms suggested in `RFC 7231,
    section 5.3.5
    <https://tools.ietf.org/html/rfc7231.html#section-5.3.5>`_. (This is
    due to a change in an underlying library, which previously used a
    matching scheme that did not conform to `RFC 7231
    <https://tools.ietf.org/html/rfc7231.html>`_.)

    Change-Id: Ib9735b394a134de9a53d577b4d8b5a9c760b7780
    Closes-bug: #1765748