summaryrefslogtreecommitdiff
path: root/horizon/api/nova.py
diff options
context:
space:
mode:
authorSascha Peilicke <saschpe@suse.de>2012-07-17 12:35:49 +0200
committerSascha Peilicke <saschpe@suse.de>2012-07-23 12:53:54 +0200
commit124cec74cfefe1fc59d166ee655036b652640bea (patch)
treee2ffca2c08667b5e193ce7cc5cf0caa7a84095c6 /horizon/api/nova.py
parent76246c6b189b4b704f286c727904e2f39e8d223e (diff)
downloadtuskar-ui-124cec74cfefe1fc59d166ee655036b652640bea.tar.gz
Allow to use SSL with self-signed certificates
SSL certificate validity checks fail with self-signed certificates used in development or in-house environments. This patch adds a new config value 'OPENSTACK_KEYSTONE_INSECURE_SSL', that allows to disable validity checks done by keystoneclient, glanceclient and novaclient. Change-Id: I4d79c1b12ad830540ca30009bd25edde10c1a055
Diffstat (limited to 'horizon/api/nova.py')
-rw-r--r--horizon/api/nova.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/horizon/api/nova.py b/horizon/api/nova.py
index 2bc3922e..f93bd31f 100644
--- a/horizon/api/nova.py
+++ b/horizon/api/nova.py
@@ -24,6 +24,9 @@ from __future__ import absolute_import
import logging
+from django.conf import settings
+from django.utils.translation import ugettext as _
+
from novaclient.v1_1 import client as nova_client
from novaclient.v1_1 import security_group_rules as nova_rules
from novaclient.v1_1.security_groups import SecurityGroup as NovaSecurityGroup
@@ -32,8 +35,6 @@ from novaclient.v1_1.servers import REBOOT_HARD
from horizon.api.base import APIResourceWrapper, APIDictWrapper, url_for
from horizon.utils.memoized import memoized
-from django.utils.translation import ugettext as _
-
LOG = logging.getLogger(__name__)
@@ -191,24 +192,28 @@ class SecurityGroupRule(APIResourceWrapper):
def novaclient(request):
+ insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
LOG.debug('novaclient connection created using token "%s" and url "%s"' %
(request.user.token.id, url_for(request, 'compute')))
c = nova_client.Client(request.user.username,
request.user.token.id,
project_id=request.user.tenant_id,
- auth_url=url_for(request, 'compute'))
+ auth_url=url_for(request, 'compute'),
+ insecure=insecure)
c.client.auth_token = request.user.token.id
c.client.management_url = url_for(request, 'compute')
return c
def cinderclient(request):
+ insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
LOG.debug('cinderclient connection created using token "%s" and url "%s"' %
(request.user.token.id, url_for(request, 'volume')))
c = nova_client.Client(request.user.username,
request.user.token.id,
project_id=request.user.tenant_id,
- auth_url=url_for(request, 'volume'))
+ auth_url=url_for(request, 'volume'),
+ insecure=insecure)
c.client.auth_token = request.user.token.id
c.client.management_url = url_for(request, 'volume')
return c