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:
Reviewed: https:/ /review. openstack. org/564883 /git.openstack. org/cgit/ openstack/ glance/ commit/ ?id=73cc41c9ceb 4e38b60ea224025 24bae49aa41c32
Committed: https:/
Submitter: Zuul
Branch: master
commit 73cc41c9ceb4e38 b60ea22402524ba e49aa41c32
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 constraints, the code be simplified to handle 1.8.x only, and
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_
the following release note be submitted with that patch:
Negotiation of the 'Accept-Language' header now follows the "Lookup" /tools. ietf.org/ html/rfc4647. html#section- 3.4>`_. The /tools. ietf.org/ html/rfc7231. html#section- 5.3.5>`_. (This is /tools. ietf.org/ html/rfc7231. html>`_.)
matching scheme described in `RFC 4647, section 3.4
<https:/
"Lookup" scheme is one of the algorithms suggested in `RFC 7231,
section 5.3.5
<https:/
due to a change in an underlying library, which previously used a
matching scheme that did not conform to `RFC 7231
<https:/
Change-Id: Ib9735b394a134d e9a53d577b4d8b5 a9c760b7780
Closes-bug: #1765748