Merge "swift: Respect the OPENSTACK_SSL_NO_VERIFY setting"

This commit is contained in:
Jenkins 2014-09-16 13:09:06 +00:00 committed by Gerrit Code Review
commit 2c02f7c11e
2 changed files with 3 additions and 0 deletions

View File

@ -107,6 +107,7 @@ def _metadata_to_header(metadata):
def swift_api(request):
endpoint = base.url_for(request, 'object-store')
cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None)
insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
LOG.debug('Swift connection created using token "%s" and url "%s"'
% (request.user.token.id, endpoint))
return swiftclient.client.Connection(None,
@ -115,6 +116,7 @@ def swift_api(request):
preauthtoken=request.user.token.id,
preauthurl=endpoint,
cacert=cacert,
insecure=insecure,
auth_version="2.0")

View File

@ -347,6 +347,7 @@ class APITestCase(TestCase):
preauthtoken=mox.IgnoreArg(),
preauthurl=mox.IgnoreArg(),
cacert=None,
insecure=False,
auth_version="2.0") \
.AndReturn(self.swiftclient)
expected_calls -= 1