summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyril Roelandt <cyril@redhat.com>2018-09-18 20:37:50 +0200
committerCyril Roelandt <cyril@redhat.com>2018-10-10 18:09:47 +0200
commit64904ea9c9d86729739bea1737bfb9320258afe1 (patch)
tree8425004ffa12118b93fc368cb590b9fa3fd8f93e
parent3e9706066917cff3e3c929aa15c6f1c5e7aac618 (diff)
Do not use Accept.best_match
Accept.best_match has been deprecated, and acceptable_offers should be used instead. Change-Id: Ida4ee116b870f8c673f6037f81a2695a8e4dde6d
Notes
Notes (review): Code-Review+2: Brian Rosmaita <rosmaita.fossdev@gmail.com> Code-Review+2: Sean McGinnis <sean.mcginnis@gmail.com> Workflow+1: Sean McGinnis <sean.mcginnis@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 17 Oct 2018 19:30:09 +0000 Reviewed-on: https://review.openstack.org/603467 Project: openstack/glance Branch: refs/heads/master
-rw-r--r--glance/common/wsgi.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/glance/common/wsgi.py b/glance/common/wsgi.py
index 95d772a..7ccd76a 100644
--- a/glance/common/wsgi.py
+++ b/glance/common/wsgi.py
@@ -1027,8 +1027,10 @@ class Request(webob.Request):
1027 def best_match_content_type(self): 1027 def best_match_content_type(self):
1028 """Determine the requested response content-type.""" 1028 """Determine the requested response content-type."""
1029 supported = ('application/json',) 1029 supported = ('application/json',)
1030 bm = self.accept.best_match(supported) 1030 best_matches = self.accept.acceptable_offers(supported)
1031 return bm or 'application/json' 1031 if not best_matches:
1032 return 'application/json'
1033 return best_matches[0][0]
1032 1034
1033 def get_content_type(self, allowed_content_types): 1035 def get_content_type(self, allowed_content_types):
1034 """Determine content type of the request body.""" 1036 """Determine content type of the request body."""