Merge "Fix cacert for tests and examples"
This commit is contained in:
@@ -31,7 +31,13 @@ def make_connection(opts):
|
|||||||
occ = os_client_config.OpenStackConfig()
|
occ = os_client_config.OpenStackConfig()
|
||||||
cloud = occ.get_one_cloud(opts.cloud, opts)
|
cloud = occ.get_one_cloud(opts.cloud, opts)
|
||||||
opts.preferences.set_region(opts.preferences.ALL, cloud.region)
|
opts.preferences.set_region(opts.preferences.ALL, cloud.region)
|
||||||
|
# TODO(thowe): There is a general smell here that this code is
|
||||||
|
# repeated in two places at that we flatten the auth structure.
|
||||||
|
# The connection class should take OCC config and just deal, but
|
||||||
|
# I'd just like to get cacert working for now.
|
||||||
auth = cloud.config['auth']
|
auth = cloud.config['auth']
|
||||||
|
if 'cacert' in cloud.config:
|
||||||
|
auth['verify'] = cloud.config['cacert']
|
||||||
if 'insecure' in cloud.config:
|
if 'insecure' in cloud.config:
|
||||||
auth['verify'] = not bool(cloud.config['insecure'])
|
auth['verify'] = not bool(cloud.config['insecure'])
|
||||||
conn = connection.Connection(profile=opts.preferences, **auth)
|
conn = connection.Connection(profile=opts.preferences, **auth)
|
||||||
|
|||||||
@@ -65,7 +65,13 @@ class BaseFunctionalTest(unittest.TestCase):
|
|||||||
if test_cloud.debug:
|
if test_cloud.debug:
|
||||||
utils.enable_logging(True, stream=sys.stdout)
|
utils.enable_logging(True, stream=sys.stdout)
|
||||||
|
|
||||||
|
# TODO(thowe): There is a general smell here that this code is
|
||||||
|
# repeated in two places at that we flatten the auth structure.
|
||||||
|
# The connection class should take OCC config and just deal, but
|
||||||
|
# I'd just like to get cacert working for now.
|
||||||
auth = test_cloud.config['auth']
|
auth = test_cloud.config['auth']
|
||||||
|
if 'cacert' in test_cloud.config:
|
||||||
|
auth['verify'] = test_cloud.config['cacert']
|
||||||
if 'insecure' in test_cloud.config:
|
if 'insecure' in test_cloud.config:
|
||||||
auth['verify'] = not bool(test_cloud.config['insecure'])
|
auth['verify'] = not bool(test_cloud.config['insecure'])
|
||||||
cls.conn = connection.Connection(profile=prof, **auth)
|
cls.conn = connection.Connection(profile=prof, **auth)
|
||||||
|
|||||||
Reference in New Issue
Block a user