diff options
author | Zuul <zuul@review.openstack.org> | 2019-04-16 00:03:47 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2019-04-16 00:03:47 +0000 |
commit | ffeb9c3b774ed2b502f4acec395bea1840f73d23 (patch) | |
tree | c2a2d700d555d65508bbe10978430c5fdf4ee6ae /oslo_middleware | |
parent | caaac6c438fd75453d3d117fc379cdc6046f47b5 (diff) | |
parent | baf3193f6a009ee9a368172d9b12efadff0ff907 (diff) | |
download | oslo-middleware-ffeb9c3b774ed2b502f4acec395bea1840f73d23.tar.gz |
Merge "Do not use the deprecated best_match() method"
Diffstat (limited to 'oslo_middleware')
-rw-r--r-- | oslo_middleware/healthcheck/__init__.py | 6 |
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) |