Fix from_response method to process response from requests
SessionClient uses requests library. It's response class doesn't have
"status" property[1], so in case of any errors(with status code > 400),
from_response method is called and raises AttributeError.
Also, HTTPClient implementation uses requests lib by default[2](if 'http'
argument was not transmitted), so from_response method will raise
AttributeError too.
Reviewed: https:/ /review. openstack. org/366638 /git.openstack. org/cgit/ openstack/ python- ceilometerclien t/commit/ ?id=090e5ffc691 c5d40e45ab0c20d c88032a0987b20
Committed: https:/
Submitter: Jenkins
Branch: stable/newton
commit 090e5ffc691c5d4 0e45ab0c20dc880 32a0987b20
Author: Andrey Kurilin <email address hidden>
Date: Wed Sep 7 12:39:12 2016 +0300
Fix from_response method to process response from requests
SessionClient uses requests library. It's response class doesn't have
"status" property[1], so in case of any errors(with status code > 400),
from_response method is called and raises AttributeError.
Also, HTTPClient implementation uses requests lib by default[2](if 'http'
argument was not transmitted), so from_response method will raise
AttributeError too.
[1] - http:// docs.python- requests. org/en/ master/ api/#requests. Response. status_ code /github. com/openstack/ python- ceilometerclien t/blob/ 2.6.0/ceilomete rclient/ openstack/ common/ apiclient/ client. py#L99- L100
[2] - https:/
Change-Id: Id8fb2f386e8101 951716f30a6365c 9aa15bd4b24 2235ce336d3df3e 7a8c1c81d2)
Closes-Bug: #1620974
(cherry picked from commit 1b1917ab9b56fe9