Fix heat and ceilometer client connection

Heat Ceilometer client plugin uses direclty the Client function of
python-ceilometerclient which does not exposes all the parameters
required to make a https connection with ceilometer. Instead of
this get_client fucntion of ceilometer client should be used which
set all the ssl parameters correctly

Change-Id: I64029b90b6fdd553b98e4a9e4a749aef6855982a
Closes-Bug: #1419772
This commit is contained in:
ishant 2015-02-09 05:07:18 -08:00
parent 054c0d732f
commit 80b13e9974

View File

@ -34,13 +34,14 @@ class CeilometerClientPlugin(client_plugin.ClientPlugin):
'project_id': con.tenant, 'project_id': con.tenant,
'token': lambda: self.auth_token, 'token': lambda: self.auth_token,
'endpoint_type': endpoint_type, 'endpoint_type': endpoint_type,
'os_endpoint': endpoint,
'cacert': self._get_client_option('ceilometer', 'ca_file'), 'cacert': self._get_client_option('ceilometer', 'ca_file'),
'cert_file': self._get_client_option('ceilometer', 'cert_file'), 'cert_file': self._get_client_option('ceilometer', 'cert_file'),
'key_file': self._get_client_option('ceilometer', 'key_file'), 'key_file': self._get_client_option('ceilometer', 'key_file'),
'insecure': self._get_client_option('ceilometer', 'insecure') 'insecure': self._get_client_option('ceilometer', 'insecure')
} }
return cc.Client('2', endpoint, **args) return cc.get_client('2', **args)
def is_not_found(self, ex): def is_not_found(self, ex):
return isinstance(ex, (exc.HTTPNotFound, api_exc.NotFound)) return isinstance(ex, (exc.HTTPNotFound, api_exc.NotFound))