Tempest rest clients does not send the accept header for GET and DELETE
Bug #1215886 reported by
Andrea Frittoli
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tempest |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Tempest rest client and all clients which rely on it do not send the accept header for GET and DELETE.
The header is aggregated to the content-type one, so it is sent only when the content-type one is needed, which is in case of POST and PUT only.
In case of rate limiting for instance, the returned content-type will be the wrong one for XML (assuming that JSON is the default returned when the header is not specified).
summary: |
- Tempest rest clients does not send the accept header in cases + Tempest rest clients does not send the accept header for GET and DELETE |
Changed in tempest: | |
status: | New → Invalid |
status: | Invalid → New |
Changed in tempest: | |
importance: | Undecided → Low |
tags: | added: low-hanging-fruit |
Changed in tempest: | |
status: | New → Confirmed |
To post a comment you must log in.
tempest. services. compute. xml.servers_ client. ServersClientXM L does use Accept header, debuging list_servers I can see:
> /opt/stack/ tempest/ tempest/ services/ compute/ xml/servers_ client. py(239) list_servers( ) array(etree. fromstring( body))
238
--> 239 resp, body = self.get(url, self.headers)
240 servers = self._parse_
pdb> self.headers
{'Content-Type': 'application/xml', 'Accept': 'application/xml', 'X-Auth-Token': <ommiting>}
and the response:
> /opt/stack/ tempest/ tempest/ services/ compute/ xml/servers_ client. py(240) list_servers( ) array(etree. fromstring( body)) 9.114.111. 27:8774/ v2/5ec615f57dcb 4419ad5a0f3ff57 0a6cc/servers', 'x-compute- request- id': 'req-01e2c636- a791-4036- ba58-46be4f34b9 ed', 'connection': 'close', 'date': 'Thu, 12 Dec 2013 14:04:53 GMT', 'content-type': 'application/xml'} \'UTF-8\ '?>\n<servers xmlns:atom="http:// www.w3. org/2005/ Atom" xmlns="http:// docs.openstack. org/compute/ api/v1. 1"><server name="server- tempest- 1339459178" id="9f72e9c3- 2547-42e3- 8504-5c76d7ba7c 4e"><atom: link href="http:// 9.114.111. 27:8774/ v2/5ec615f57dcb 4419ad5a0f3ff57 0a6cc/servers/ 9f72e9c3- 2547-42e3- 8504-5c76d7ba7c 4e" rel="self" /><atom: link href="http:// 9.114.111. 27:8774/ 5ec615f57dcb441 9ad5a0f3ff570a6 cc/servers/ 9f72e9c3- 2547-42e3- 8504-5c76d7ba7c 4e" rel="bookmark" /></server> </servers> '
239 resp, body = self.get(url, self.headers)
--> 240 servers = self._parse_
241 return resp, {"servers": servers}
ipdb> resp
{'status': '200', 'content-length': '515', 'content-location': u'http://
ipdb> body
'<?xml version=\'1.0\' encoding=
came in xml as expected.