Update to requests >= 0.8
The requests module dropped all configuration with the 1.0.0 release. There's no danger_mode and no 'verbose'' mode. The former shouldn't be necessary anymore and the latter can be done by setting a different log handler for the request.logging root logger. Change-Id: Iec169ef6e39097814cdbf1b777bc0590236692ba
This commit is contained in:
parent
1ea7e65d85
commit
c73afa9fd1
@ -44,10 +44,6 @@ class HTTPClient(object):
|
||||
|
||||
USER_AGENT = 'python-novaclient'
|
||||
|
||||
requests_config = {
|
||||
'danger_mode': False,
|
||||
}
|
||||
|
||||
def __init__(self, user, password, projectid, auth_url=None,
|
||||
insecure=False, timeout=None, proxy_tenant_id=None,
|
||||
proxy_token=None, region_name=None,
|
||||
@ -104,7 +100,8 @@ class HTTPClient(object):
|
||||
ch = logging.StreamHandler()
|
||||
self._logger.setLevel(logging.DEBUG)
|
||||
self._logger.addHandler(ch)
|
||||
self.requests_config['verbose'] = sys.stderr
|
||||
if hasattr(requests, logging):
|
||||
requests.logging.getLogger(requests.__name__).addHandler(ch)
|
||||
|
||||
def use_token_cache(self, use_it):
|
||||
self.os_cache = use_it
|
||||
@ -167,7 +164,6 @@ class HTTPClient(object):
|
||||
method,
|
||||
url,
|
||||
verify=self.verify_cert,
|
||||
config=self.requests_config,
|
||||
**kwargs)
|
||||
self.http_log_resp(resp)
|
||||
|
||||
|
@ -43,8 +43,7 @@ class ClientTest(utils.TestCase):
|
||||
requests.request.assert_called_with(mock.ANY, mock.ANY,
|
||||
timeout=2,
|
||||
headers=mock.ANY,
|
||||
verify=mock.ANY,
|
||||
config=mock.ANY)
|
||||
verify=mock.ANY)
|
||||
|
||||
def test_get_client_class_v2(self):
|
||||
output = novaclient.client.get_client_class('2')
|
||||
|
@ -7,7 +7,6 @@ import testtools
|
||||
|
||||
class TestCase(testtools.TestCase):
|
||||
TEST_REQUEST_BASE = {
|
||||
'config': {'danger_mode': False},
|
||||
'verify': True,
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
argparse
|
||||
iso8601>=0.1.4
|
||||
prettytable>=0.6,<0.7
|
||||
requests<1.0
|
||||
requests>=0.8
|
||||
simplejson
|
||||
|
Loading…
x
Reference in New Issue
Block a user