summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyril Roelandt <cyril@redhat.com>2019-03-21 21:50:10 +0100
committerCyril Roelandt <cyril@redhat.com>2019-03-28 21:32:21 +0100
commitbaf3193f6a009ee9a368172d9b12efadff0ff907 (patch)
tree174ef9ca999e9847b939d28c59d32f7b0481af61
parentc3ab308d08d7e23ae3bbe84031d97e02a3f5dde6 (diff)
downloadoslo-middleware-baf3193f6a009ee9a368172d9b12efadff0ff907.tar.gz
Do not use the deprecated best_match() method
This requires an upgrade of WebOb to 1.8.0. Change-Id: Ifb0abb958ca30f19b4937384d9d732e2dc4e35a5
-rw-r--r--lower-constraints.txt2
-rw-r--r--oslo_middleware/healthcheck/__init__.py6
-rw-r--r--requirements.txt2
3 files changed, 6 insertions, 4 deletions
diff --git a/lower-constraints.txt b/lower-constraints.txt
index 61ded8d..218d7a4 100644
--- a/lower-constraints.txt
+++ b/lower-constraints.txt
@@ -47,5 +47,5 @@ stevedore==1.20.0
testtools==2.2.0
traceback2==1.4.0
unittest2==1.1.0
-WebOb==1.7.1
+WebOb==1.8.0
wrapt==1.7.0
diff --git a/oslo_middleware/healthcheck/__init__.py b/oslo_middleware/healthcheck/__init__.py
index 13985cb..bd81f0b 100644
--- a/oslo_middleware/healthcheck/__init__.py
+++ b/oslo_middleware/healthcheck/__init__.py
@@ -552,8 +552,10 @@ Reason
status = self.HEAD_HEALTHY_TO_STATUS_CODES[healthy]
else:
status = self.HEALTHY_TO_STATUS_CODES[healthy]
- accept_type = req.accept.best_match(self._accept_order)
- if not accept_type:
+ try:
+ offers = req.accept.acceptable_offers(self._accept_order)
+ accept_type = offers[0][0]
+ except IndexError:
accept_type = self._default_accept
functor = self._accept_to_functor[accept_type]
body, content_type = functor(results, healthy)
diff --git a/requirements.txt b/requirements.txt
index 2273d00..2304183 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -10,6 +10,6 @@ oslo.i18n>=3.15.3 # Apache-2.0
oslo.utils>=3.33.0 # Apache-2.0
six>=1.10.0 # MIT
stevedore>=1.20.0 # Apache-2.0
-WebOb>=1.7.1 # MIT
+WebOb>=1.8.0 # MIT
debtcollector>=1.2.0 # Apache-2.0
statsd>=3.2.1 # MIT