Don't use a connection pool unless provided

To prevent left over TCP connections from keystoneclient not correctly
cleaning up we shouldn't use a connection pool. This is not ideal but it
was a relatively new addition so shouldn't affect performance.

When we are able to find a long term solution to keystoneclient's other
problems we can move back to using a connection pool.

Change-Id: I45678ef89b88eea90ea04de1e3170f584b51fd8f
Closes-Bug: #1282089
This commit is contained in:
Jamie Lennox
2014-03-21 16:59:09 +10:00
parent b5152b2320
commit 5bc03ae94e
2 changed files with 4 additions and 5 deletions

View File

@@ -14,7 +14,6 @@ import mock
import requests
from keystoneclient import httpclient
from keystoneclient import session
from keystoneclient.tests import utils
@@ -50,7 +49,7 @@ class ClientTest(utils.TestCase):
self.request_patcher.start()
self.addCleanup(self.request_patcher.stop)
@mock.patch.object(session.requests.Session, 'request')
@mock.patch.object(requests, 'request')
def test_get(self, MOCK_REQUEST):
MOCK_REQUEST.return_value = FAKE_RESPONSE
cl = get_authed_client()
@@ -69,7 +68,7 @@ class ClientTest(utils.TestCase):
# Automatic JSON parsing
self.assertEqual(body, {"hi": "there"})
@mock.patch.object(session.requests.Session, 'request')
@mock.patch.object(requests, 'request')
def test_post(self, MOCK_REQUEST):
MOCK_REQUEST.return_value = FAKE_RESPONSE
cl = get_authed_client()
@@ -86,7 +85,7 @@ class ClientTest(utils.TestCase):
self.assertEqual(mock_kwargs['cert'], ('cert.pem', 'key.pem'))
self.assertEqual(mock_kwargs['verify'], 'ca.pem')
@mock.patch.object(session.requests.Session, 'request')
@mock.patch.object(requests, 'request')
def test_post_auth(self, MOCK_REQUEST):
MOCK_REQUEST.return_value = FAKE_RESPONSE
cl = httpclient.HTTPClient(

View File

@@ -441,7 +441,7 @@ class ShellTest(utils.TestCase):
'endpoints': [],
})
request_mock = mock.MagicMock(return_value=response_mock)
with mock.patch.object(session.requests.Session, 'request',
with mock.patch.object(session.requests, 'request',
request_mock):
shell(('--timeout 2 --os-token=blah --os-endpoint=blah'
' --os-auth-url=blah.com endpoint-list'))