ceilometerclient insecure argument no longer works

The os_insecure argument needs to be parsed and passed to the auth
plugin for non-shell usage.

Change-Id: Id45a680396a9b646b273d971a0f6c274e95019a6
Closes-Bug: #1438750
This commit is contained in:
Matthew Edmonds
2015-03-31 09:53:15 -04:00
parent d6ce587e95
commit a5df77d873
2 changed files with 12 additions and 1 deletions

View File

@@ -228,6 +228,7 @@ def _adjust_kwargs(kwargs):
'region_name': kwargs.get('os_region_name'),
'service_type': kwargs.get('os_service_type'),
'endpoint_type': kwargs.get('os_endpoint_type'),
'insecure': kwargs.get('os_insecure'),
'cacert': kwargs.get('os_cacert'),
'cert_file': kwargs.get('os_cert'),
'key_file': kwargs.get('os_key'),
@@ -299,7 +300,7 @@ def get_client(version, **kwargs):
* os_auth_url: endpoint to authenticate against
* os_cert|os_cacert: path of CA TLS certificate
* os_key: SSL private key
* insecure: allow insecure SSL (no cert verification)
* os_insecure: allow insecure SSL (no cert verification)
"""
endpoint = kwargs.get('os_endpoint') or kwargs.get('ceilometer_url')
@@ -312,6 +313,7 @@ def get_auth_plugin(endpoint, **kwargs):
service_type=kwargs.get('service_type'),
token=kwargs.get('token'),
endpoint_type=kwargs.get('endpoint_type'),
insecure=kwargs.get('insecure'),
cacert=kwargs.get('cacert'),
tenant_id=kwargs.get('project_id') or kwargs.get('tenant_id'),
endpoint=endpoint,

View File

@@ -83,6 +83,7 @@ class ClientTest(utils.BaseTestCase):
'endpoint_type': None,
'auth_url': 'http://no.where',
'tenant_id': None,
'insecure': None,
'cacert': None,
'password': 'password',
'user_domain_name': 'default',
@@ -147,6 +148,14 @@ class ClientTest(utils.BaseTestCase):
self.assertEqual(('/path/to/cert', '/path/to/keycert'),
client.client.cert)
def test_v2_client_insecure(self):
env = FAKE_ENV.copy()
env.pop('auth_plugin')
env['insecure'] = 'True'
client = self.create_client(env)
self.assertIn('insecure', client.auth_plugin.opts)
self.assertEqual('True', client.auth_plugin.opts['insecure'])
class ClientTest2(ClientTest):
@staticmethod