From 0fe6997856ae39afcbed0ad53cc2916ec369c9d5 Mon Sep 17 00:00:00 2001 From: Travis Ankrom Date: Wed, 12 Feb 2014 10:41:04 -0500 Subject: [PATCH] Pass certificate, key and cacert to glanceclient When glance is configured with ssl nova does not pass it's certificate, key, or cacert. Updated the code to pass the certificate, key, and cacert used in the nova.conf file, if they are set. Removed nested if statement. Change-Id: I23fcd070994e435cb42aa09c824d13553503a7c5 Closes-Bug: #1279381 --- nova/image/glance.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nova/image/glance.py b/nova/image/glance.py index a264338aa780..98df2106f811 100644 --- a/nova/image/glance.py +++ b/nova/image/glance.py @@ -86,6 +86,7 @@ CONF = cfg.CONF CONF.register_opts(glance_opts, 'glance') CONF.import_opt('auth_strategy', 'nova.api.auth') CONF.import_opt('my_ip', 'nova.netconf') +CONF.import_group('ssl', 'nova.openstack.common.sslutils') def generate_glance_url(): @@ -137,6 +138,12 @@ def _create_glance_client(context, host, port, use_ssl, version=1): # https specific params params['insecure'] = CONF.glance.api_insecure params['ssl_compression'] = False + if CONF.ssl.cert_file: + params['cert_file'] = CONF.ssl.cert_file + if CONF.ssl.key_file: + params['key_file'] = CONF.ssl.key_file + if CONF.ssl.ca_file: + params['cacert'] = CONF.ssl.ca_file else: scheme = 'http'