Set correctly request parameters for the list_resources request

The Neutron API requires that the content_type and accept headers
are correcty set in the request. This commit permit to fix this
issue.

It has been successfully tested with Tox.

Closes-Bug: 1754096

Change-Id: I977f97cd0692a86bac1d817fa1c4de27889f2675
This commit is contained in:
Jerome Pansanel 2018-03-07 18:14:15 +01:00
parent 9ab7f8299b
commit db1a78a9c8
1 changed files with 3 additions and 0 deletions

View File

@ -85,6 +85,9 @@ class OpenStackNeutron(helpers.BaseHelper):
:param tenant: include tenant in the query parameters
"""
path = "/%s" % resource
if req:
req.accept = "application/json"
req.content_type = "application/json"
os_req = self._make_get_request(req, path, parameters)
response = os_req.get_response()
return self.get_from_response(response, resource, [])