From 6b821beb4e712df5427f5fc3213fc6e597262274 Mon Sep 17 00:00:00 2001 From: Pradeep Kilambi Date: Wed, 10 Jan 2018 14:42:45 -0500 Subject: [PATCH] Drop ceilometerclient requirement ceilometerclient is dead in queens cycle, lets drop the integration and remove the requirement. Change-Id: I5267746e63fd27ad0ce8e36fb843efd4988d6eb7 --- README.rst | 1 - heat/common/config.py | 2 +- heat/engine/clients/os/ceilometer.py | 51 ------------------- heat/engine/resource.py | 3 -- heat/tests/clients/test_ceilometer_client.py | 27 ---------- heat/tests/clients/test_clients.py | 33 ------------ ...rop-ceilometerclient-868ee47eedf2dff4.yaml | 7 +++ requirements.txt | 1 - setup.cfg | 1 - 9 files changed, 8 insertions(+), 118 deletions(-) delete mode 100644 heat/engine/clients/os/ceilometer.py delete mode 100644 heat/tests/clients/test_ceilometer_client.py create mode 100644 releasenotes/notes/drop-ceilometerclient-868ee47eedf2dff4.yaml diff --git a/README.rst b/README.rst index 6add1af7cf..5c014dd2b3 100644 --- a/README.rst +++ b/README.rst @@ -48,7 +48,6 @@ We have integration with * https://git.openstack.org/cgit/openstack/python-keystoneclient (auth) * https://git.openstack.org/cgit/openstack/python-swiftclient (object storage) * https://git.openstack.org/cgit/openstack/python-neutronclient (networking) -* https://git.openstack.org/cgit/openstack/python-ceilometerclient (metering) * https://git.openstack.org/cgit/openstack/python-aodhclient (alarming service) * https://git.openstack.org/cgit/openstack/python-cinderclient (block storage) * https://git.openstack.org/cgit/openstack/python-glanceclient (image service) diff --git a/heat/common/config.py b/heat/common/config.py index b33516dc01..e64d970614 100644 --- a/heat/common/config.py +++ b/heat/common/config.py @@ -421,7 +421,7 @@ def list_opts(): yield profiler.list_opts()[0] yield 'clients', default_clients_opts - for client in ('aodh', 'barbican', 'ceilometer', 'cinder', 'designate', + for client in ('aodh', 'barbican', 'cinder', 'designate', 'glance', 'heat', 'keystone', 'magnum', 'manila', 'mistral', 'monasca', 'neutron', 'nova', 'octavia', 'sahara', 'senlin', 'swift', 'trove', 'zaqar' diff --git a/heat/engine/clients/os/ceilometer.py b/heat/engine/clients/os/ceilometer.py deleted file mode 100644 index 1436b3290e..0000000000 --- a/heat/engine/clients/os/ceilometer.py +++ /dev/null @@ -1,51 +0,0 @@ -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from ceilometerclient import client as cc -from ceilometerclient import exc - -from heat.engine.clients import client_plugin - -CLIENT_NAME = 'ceilometer' - - -class CeilometerClientPlugin(client_plugin.ClientPlugin): - - exceptions_module = exc - - service_types = [METERING, ALARMING] = ['metering', 'alarming'] - - def _create(self): - - con = self.context - interface = self._get_client_option(CLIENT_NAME, 'endpoint_type') - aodh_endpoint = self.url_for(service_type=self.ALARMING, - endpoint_type=interface) - args = { - 'session': con.keystone_session, - 'interface': interface, - 'service_type': self.METERING, - 'aodh_endpoint': aodh_endpoint, - 'region_name': self._get_region_name() - } - - return cc.get_client('2', **args) - - def is_not_found(self, ex): - return isinstance(ex, exc.HTTPNotFound) - - def is_over_limit(self, ex): - return isinstance(ex, exc.HTTPOverLimit) - - def is_conflict(self, ex): - return isinstance(ex, exc.HTTPConflict) diff --git a/heat/engine/resource.py b/heat/engine/resource.py index d0dd29fd24..67bf815b25 100644 --- a/heat/engine/resource.py +++ b/heat/engine/resource.py @@ -847,9 +847,6 @@ class Resource(status.ResourceStatus): def trove(self): return self.client('trove') - def ceilometer(self): - return self.client('ceilometer') - def heat(self): return self.client('heat') diff --git a/heat/tests/clients/test_ceilometer_client.py b/heat/tests/clients/test_ceilometer_client.py deleted file mode 100644 index c3d3dbd57d..0000000000 --- a/heat/tests/clients/test_ceilometer_client.py +++ /dev/null @@ -1,27 +0,0 @@ -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from ceilometerclient import client as cc - -from heat.tests import common -from heat.tests import utils - - -class CeilometerClientPluginTest(common.HeatTestCase): - - def test_create(self): - self.patchobject(cc.SessionClient, 'request') - context = utils.dummy_context() - plugin = context.clients.client_plugin('ceilometer') - client = plugin.client() - self.assertIsNotNone(client.alarms) diff --git a/heat/tests/clients/test_clients.py b/heat/tests/clients/test_clients.py index 0c57c99ad3..83fd36ac93 100644 --- a/heat/tests/clients/test_clients.py +++ b/heat/tests/clients/test_clients.py @@ -12,7 +12,6 @@ # under the License. from aodhclient import exceptions as aodh_exc -from ceilometerclient import exc as ceil_exc from cinderclient import exceptions as cinder_exc from glanceclient import exc as glance_exc from heatclient import client as heatclient @@ -340,38 +339,6 @@ class TestClientPluginsInitialise(common.HeatTestCase): class TestIsNotFound(common.HeatTestCase): scenarios = [ - ('ceilometer_not_found', dict( - is_not_found=True, - is_over_limit=False, - is_client_exception=True, - is_conflict=False, - plugin='ceilometer', - exception=lambda: ceil_exc.HTTPNotFound(details='gone'), - )), - ('ceilometer_exception', dict( - is_not_found=False, - is_over_limit=False, - is_client_exception=False, - is_conflict=False, - plugin='ceilometer', - exception=lambda: Exception() - )), - ('ceilometer_overlimit', dict( - is_not_found=False, - is_over_limit=True, - is_client_exception=True, - is_conflict=False, - plugin='ceilometer', - exception=lambda: ceil_exc.HTTPOverLimit(details='over'), - )), - ('ceilometer_conflict', dict( - is_not_found=False, - is_over_limit=False, - is_client_exception=True, - is_conflict=True, - plugin='ceilometer', - exception=lambda: ceil_exc.HTTPConflict(), - )), ('aodh_not_found', dict( is_not_found=True, is_over_limit=False, diff --git a/releasenotes/notes/drop-ceilometerclient-868ee47eedf2dff4.yaml b/releasenotes/notes/drop-ceilometerclient-868ee47eedf2dff4.yaml new file mode 100644 index 0000000000..734a9c8e68 --- /dev/null +++ b/releasenotes/notes/drop-ceilometerclient-868ee47eedf2dff4.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + The ceilometer client plugin is no longer provided, + due to the Ceilometer API no longer being available from + Queens and the python-ceilometerclient library being + unmaintained. \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index af7fb54a7b..5be9c7903a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,7 +33,6 @@ PasteDeploy>=1.5.0 # MIT aodhclient>=0.9.0 # Apache-2.0 python-barbicanclient>=4.5.2 # Apache-2.0 python-blazarclient>=1.0.0 # Apache-2.0 -python-ceilometerclient>=2.5.0 # Apache-2.0 python-cinderclient>=3.3.0 # Apache-2.0 python-designateclient>=2.7.0 # Apache-2.0 python-glanceclient>=2.8.0 # Apache-2.0 diff --git a/setup.cfg b/setup.cfg index 4cdd0b5db0..21078c38f0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -66,7 +66,6 @@ heat.clients = aodh = heat.engine.clients.os.aodh:AodhClientPlugin barbican = heat.engine.clients.os.barbican:BarbicanClientPlugin blazar = heat.engine.clients.os.blazar:BlazarClientPlugin - ceilometer = heat.engine.clients.os.ceilometer:CeilometerClientPlugin cinder = heat.engine.clients.os.cinder:CinderClientPlugin designate = heat.engine.clients.os.designate:DesignateClientPlugin glance = heat.engine.clients.os.glance:GlanceClientPlugin