Comment 3 for bug 1870264

Revision history for this message
Tobias Urdin (tobias-urdin) wrote :

Issue is that it assumes a python-requests response class but it might be a HTTPResponse. We should assume using the body unless it's a requests response.

    return self._update(self._path(id), patch)
  File "/usr/lib/python2.7/site-packages/magnumclient/common/base.py", line 131, in _update
    resp, resp_body = self.api.json_request(method, url, body=body)
  File "/usr/lib/python2.7/site-packages/magnumclient/common/httpclient.py", line 233, in json_request
    resp, body_iter = self._http_request(url, method, **kwargs)
  File "/usr/lib/python2.7/site-packages/magnumclient/common/httpclient.py", line 213, in _http_request
    error_json = _extract_error_json(body_str, resp)
  File "/usr/lib/python2.7/site-packages/magnumclient/common/httpclient.py", line 66, in _extract_error_json
    body_json = resp.json()
AttributeError: HTTPResponse instance has no attribute 'json'