Merge "Log the CA cert with the debug statement"

This commit is contained in:
Jenkins 2014-12-11 23:49:24 +00:00 committed by Gerrit Code Review
commit b9f17e3bbb
2 changed files with 12 additions and 0 deletions
keystoneclient

@ -151,6 +151,8 @@ class Session(object):
# so we need to actually check that this is False.
if self.verify is False:
string_parts.append('--insecure')
elif isinstance(self.verify, six.string_types):
string_parts.append('--cacert "%s"' % self.verify)
if method:
string_parts.extend(['-X', method])

@ -172,6 +172,16 @@ class SessionTests(utils.TestCase):
self.assertEqual(v, resp.headers[k])
self.assertNotIn(v, self.logger.output)
def test_logging_cacerts(self):
path_to_certs = '/path/to/certs'
session = client_session.Session(verify=path_to_certs)
self.stub_url('GET', text='text')
session.get(self.TEST_URL)
self.assertIn('--cacert', self.logger.output)
self.assertIn(path_to_certs, self.logger.output)
def test_connect_retries(self):
def _timeout_error(request, context):