Fix versions api by using webob correctly

Currently getting the following error:
TypeError: You cannot set Response.body to a text object (use Response.text)

Closes-Bug: #1882156

Change-Id: Iba918ec671dabb2d0df72e071c6279176c63b312
(cherry picked from commit cd27f95c0b)
This commit is contained in:
Sam Morrison 2020-06-03 10:11:16 +10:00 committed by zhurong
parent 9718a52743
commit fa8332f48f
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ class Controller(object):
response = webob.Response(request=req, response = webob.Response(request=req,
status=http_client.MULTIPLE_CHOICES, status=http_client.MULTIPLE_CHOICES,
content_type='application/json') content_type='application/json')
response.body = jsonutils.dumps(dict(versions=version_objs)) response.text = jsonutils.dumps(dict(versions=version_objs))
return response return response
@webob.dec.wsgify(RequestClass=wsgi.Request) @webob.dec.wsgify(RequestClass=wsgi.Request)