From 508fad109daa3bd5011dad9d9ccc2e8baccfc3df Mon Sep 17 00:00:00 2001 From: Julien Danjou <julien@danjou.info> Date: Tue, 22 Aug 2017 17:42:09 +0200 Subject: [PATCH] Remove deprecated *_control_exchange Change-Id: Id0c976b7e7e57fe9fd908376edc2c85dd1aa2abf --- ceilometer/exchange_control.py | 82 ------------------- ceilometer/opts.py | 2 - ceilometer/telemetry/notifications.py | 9 +- .../tests/functional/test_notification.py | 9 +- ...ange-control-options-75ecd49423639068.yaml | 4 + 5 files changed, 16 insertions(+), 90 deletions(-) delete mode 100644 ceilometer/exchange_control.py create mode 100644 releasenotes/notes/remove-exchange-control-options-75ecd49423639068.yaml diff --git a/ceilometer/exchange_control.py b/ceilometer/exchange_control.py deleted file mode 100644 index c72735d437..0000000000 --- a/ceilometer/exchange_control.py +++ /dev/null @@ -1,82 +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 oslo_config import cfg - -EXCHANGE_OPTS = [ - cfg.StrOpt('nova_control_exchange', - default='nova', - help="Exchange name for Nova notifications.", - deprecated_for_removal=True, - deprecated_reason="Use notification_control_exchanges instead"), - cfg.StrOpt('neutron_control_exchange', - default='neutron', - help="Exchange name for Neutron notifications.", - deprecated_for_removal=True, - deprecated_reason="Use notification_control_exchanges instead"), - cfg.StrOpt('heat_control_exchange', - default='heat', - help="Exchange name for Heat notifications", - deprecated_for_removal=True, - deprecated_reason="Use notification_control_exchanges instead"), - cfg.StrOpt('glance_control_exchange', - default='glance', - help="Exchange name for Glance notifications.", - deprecated_for_removal=True, - deprecated_reason="Use notification_control_exchanges instead"), - cfg.StrOpt('keystone_control_exchange', - default='keystone', - help="Exchange name for Keystone notifications.", - deprecated_for_removal=True, - deprecated_reason="Use notification_control_exchanges instead"), - cfg.StrOpt('cinder_control_exchange', - default='cinder', - help="Exchange name for Cinder notifications.", - deprecated_for_removal=True, - deprecated_reason="Use notification_control_exchanges instead"), - cfg.StrOpt('sahara_control_exchange', - default='sahara', - help="Exchange name for Data Processing notifications.", - deprecated_for_removal=True, - deprecated_reason="Use notification_control_exchanges instead"), - cfg.StrOpt('swift_control_exchange', - default='swift', - help="Exchange name for Swift notifications.", - deprecated_for_removal=True, - deprecated_reason="Use notification_control_exchanges instead"), - cfg.StrOpt('magnum_control_exchange', - default='magnum', - help="Exchange name for Magnum notifications.", - deprecated_for_removal=True, - deprecated_reason="Use notification_control_exchanges instead"), - cfg.StrOpt('trove_control_exchange', - default='trove', - help="Exchange name for DBaaS notifications.", - deprecated_for_removal=True, - deprecated_reason="Use notification_control_exchanges instead"), - cfg.StrOpt('zaqar_control_exchange', - default='zaqar', - help="Exchange name for Messaging service notifications.", - deprecated_for_removal=True, - deprecated_reason="Use notification_control_exchanges instead"), - cfg.StrOpt('dns_control_exchange', - default='central', - help="Exchange name for DNS service notifications.", - deprecated_for_removal=True, - deprecated_reason="Use notification_control_exchanges instead"), - cfg.StrOpt('ceilometer_control_exchange', - default='ceilometer', - help="Exchange name for ceilometer notifications.", - deprecated_for_removal=True, - deprecated_reason="Use notification_control_exchanges instead"), -] diff --git a/ceilometer/opts.py b/ceilometer/opts.py index b11acab091..a5e7d70730 100644 --- a/ceilometer/opts.py +++ b/ceilometer/opts.py @@ -31,7 +31,6 @@ import ceilometer.dispatcher.file import ceilometer.dispatcher.gnocchi_opts import ceilometer.dispatcher.http import ceilometer.event.converter -import ceilometer.exchange_control import ceilometer.hardware.discovery import ceilometer.hardware.pollsters.generic import ceilometer.image.discovery @@ -91,7 +90,6 @@ def list_opts(): ceilometer.pipeline.OPTS, ceilometer.sample.OPTS, ceilometer.utils.OPTS, - ceilometer.exchange_control.EXCHANGE_OPTS, OPTS)), ('api', itertools.chain(ceilometer.api.app.API_OPTS, ceilometer.api.controllers.v2.root.API_OPTS)), diff --git a/ceilometer/telemetry/notifications.py b/ceilometer/telemetry/notifications.py index 9cd9072091..fd9db0da7c 100644 --- a/ceilometer/telemetry/notifications.py +++ b/ceilometer/telemetry/notifications.py @@ -26,9 +26,12 @@ class TelemetryBase(plugin_base.NotificationBase): Sequence defining the exchange and topics to be connected for this plugin. """ - return [oslo_messaging.Target( - topic=topic, exchange=conf.ceilometer_control_exchange) - for topic in self.get_notification_topics(conf)] + return [ + oslo_messaging.Target( + topic=topic, + exchange=conf.notification.notification_control_exchanges[0]) + for topic in self.get_notification_topics(conf) + ] class TelemetryIpc(TelemetryBase): diff --git a/ceilometer/tests/functional/test_notification.py b/ceilometer/tests/functional/test_notification.py index 15bf78fa6f..993eda7bd5 100644 --- a/ceilometer/tests/functional/test_notification.py +++ b/ceilometer/tests/functional/test_notification.py @@ -86,9 +86,12 @@ class _FakeNotificationPlugin(plugin_base.NotificationBase): event_types = ['fake.event'] def get_targets(self, conf): - return [oslo_messaging.Target( - topic=topic, exchange=conf.nova_control_exchange) - for topic in self.get_notification_topics(conf)] + return [ + oslo_messaging.Target( + topic=topic, + exchange=conf.notification.notification_control_exchanges[0]) + for topic in self.get_notification_topics(conf) + ] def process_notification(self, message): return [] diff --git a/releasenotes/notes/remove-exchange-control-options-75ecd49423639068.yaml b/releasenotes/notes/remove-exchange-control-options-75ecd49423639068.yaml new file mode 100644 index 0000000000..480e7722a2 --- /dev/null +++ b/releasenotes/notes/remove-exchange-control-options-75ecd49423639068.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + The deprecated control exchange options have been removed.