summaryrefslogtreecommitdiff
path: root/oslo_middleware/healthcheck/__init__.py
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 /oslo_middleware/healthcheck/__init__.py
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
Diffstat (limited to 'oslo_middleware/healthcheck/__init__.py')
-rw-r--r--oslo_middleware/healthcheck/__init__.py6
1 files changed, 4 insertions, 2 deletions
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)