Merge "Allow to use SSL with self-signed certificates"
This commit is contained in:
commit
fd56b24491
@ -37,9 +37,11 @@ LOG = logging.getLogger(__name__)
|
|||||||
def glanceclient(request):
|
def glanceclient(request):
|
||||||
o = urlparse.urlparse(url_for(request, 'image'))
|
o = urlparse.urlparse(url_for(request, 'image'))
|
||||||
url = "://".join((o.scheme, o.netloc))
|
url = "://".join((o.scheme, o.netloc))
|
||||||
|
insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
|
||||||
LOG.debug('glanceclient connection created using token "%s" and url "%s"'
|
LOG.debug('glanceclient connection created using token "%s" and url "%s"'
|
||||||
% (request.user.token.id, url))
|
% (request.user.token.id, url))
|
||||||
return glance_client.Client(endpoint=url, token=request.user.token.id)
|
return glance_client.Client(endpoint=url, token=request.user.token.id,
|
||||||
|
insecure=insecure)
|
||||||
|
|
||||||
|
|
||||||
def image_delete(request, image_id):
|
def image_delete(request, image_id):
|
||||||
|
@ -112,9 +112,11 @@ def keystoneclient(request, admin=False):
|
|||||||
conn = getattr(request, cache_attr)
|
conn = getattr(request, cache_attr)
|
||||||
else:
|
else:
|
||||||
endpoint = _get_endpoint_url(request, endpoint_type)
|
endpoint = _get_endpoint_url(request, endpoint_type)
|
||||||
|
insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
|
||||||
LOG.debug("Creating a new keystoneclient connection to %s." % endpoint)
|
LOG.debug("Creating a new keystoneclient connection to %s." % endpoint)
|
||||||
conn = keystone_client.Client(token=user.token.id,
|
conn = keystone_client.Client(token=user.token.id,
|
||||||
endpoint=endpoint)
|
endpoint=endpoint,
|
||||||
|
insecure=insecure)
|
||||||
setattr(request, cache_attr, conn)
|
setattr(request, cache_attr, conn)
|
||||||
return conn
|
return conn
|
||||||
|
|
||||||
|
@ -24,6 +24,9 @@ from __future__ import absolute_import
|
|||||||
|
|
||||||
import logging
|
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 client as nova_client
|
||||||
from novaclient.v1_1 import security_group_rules as nova_rules
|
from novaclient.v1_1 import security_group_rules as nova_rules
|
||||||
from novaclient.v1_1.security_groups import SecurityGroup as NovaSecurityGroup
|
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.api.base import APIResourceWrapper, APIDictWrapper, url_for
|
||||||
from horizon.utils.memoized import memoized
|
from horizon.utils.memoized import memoized
|
||||||
|
|
||||||
from django.utils.translation import ugettext as _
|
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -191,24 +192,28 @@ class SecurityGroupRule(APIResourceWrapper):
|
|||||||
|
|
||||||
|
|
||||||
def novaclient(request):
|
def novaclient(request):
|
||||||
|
insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
|
||||||
LOG.debug('novaclient connection created using token "%s" and url "%s"' %
|
LOG.debug('novaclient connection created using token "%s" and url "%s"' %
|
||||||
(request.user.token.id, url_for(request, 'compute')))
|
(request.user.token.id, url_for(request, 'compute')))
|
||||||
c = nova_client.Client(request.user.username,
|
c = nova_client.Client(request.user.username,
|
||||||
request.user.token.id,
|
request.user.token.id,
|
||||||
project_id=request.user.tenant_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.auth_token = request.user.token.id
|
||||||
c.client.management_url = url_for(request, 'compute')
|
c.client.management_url = url_for(request, 'compute')
|
||||||
return c
|
return c
|
||||||
|
|
||||||
|
|
||||||
def cinderclient(request):
|
def cinderclient(request):
|
||||||
|
insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
|
||||||
LOG.debug('cinderclient connection created using token "%s" and url "%s"' %
|
LOG.debug('cinderclient connection created using token "%s" and url "%s"' %
|
||||||
(request.user.token.id, url_for(request, 'volume')))
|
(request.user.token.id, url_for(request, 'volume')))
|
||||||
c = nova_client.Client(request.user.username,
|
c = nova_client.Client(request.user.username,
|
||||||
request.user.token.id,
|
request.user.token.id,
|
||||||
project_id=request.user.tenant_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.auth_token = request.user.token.id
|
||||||
c.client.management_url = url_for(request, 'volume')
|
c.client.management_url = url_for(request, 'volume')
|
||||||
return c
|
return c
|
||||||
|
@ -60,6 +60,9 @@ OPENSTACK_HOST = "127.0.0.1"
|
|||||||
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
|
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
|
||||||
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"
|
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"
|
||||||
|
|
||||||
|
# Disable SSL certificate checks (useful for self-signed certificates):
|
||||||
|
# OPENSTACK_SSL_NO_VERIFY = True
|
||||||
|
|
||||||
# The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
|
# The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
|
||||||
# capabilities of the auth backend for Keystone.
|
# capabilities of the auth backend for Keystone.
|
||||||
# If Keystone has been configured to use LDAP as the auth backend then set
|
# If Keystone has been configured to use LDAP as the auth backend then set
|
||||||
|
Loading…
x
Reference in New Issue
Block a user