Add support for OPENSTACK_SSL_{CACERT,NO_VERIFY}

This adds support for the both options mentionned in the title. The ca
certificate was wrongfully passed to keystoneauth through the 'cert' parameter,
which is meant for the client certificate.

Change-Id: I9a6759a8546a235975177bbea59334aa23f99328
Story: 2003689
Task: 26223
Depends-On: https://review.openstack.org/#/c/600510/
This commit is contained in:
Luka Peschke 2018-09-06 20:55:03 +02:00
parent 8b342a8372
commit 6ac7b2e7f1
1 changed files with 3 additions and 1 deletions

View File

@ -27,6 +27,7 @@ from cloudkittydashboard import utils
def cloudkittyclient(request):
"""Initialization of Cloudkitty client."""
cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None)
insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
auth_url = getattr(settings, 'OPENSTACK_KEYSTONE_URL', None)
auth = Token(
auth_url,
@ -37,7 +38,8 @@ def cloudkittyclient(request):
return ck_client.Client(
'1',
auth=auth,
cert=cacert)
cacert=cacert,
insecure=insecure)
def identify(what, name=False, key=None):