From ecdd7522e8c427fde0fad2e7122c38381f8035f5 Mon Sep 17 00:00:00 2001 From: Brian Rosmaita Date: Sat, 22 Aug 2020 15:35:38 -0400 Subject: [PATCH] Stop sending notifications to nonstandard pub id Change I2550b00127ee2533b0ab12c4efb4927dbcaaa190 in Ussuri deprecated sending os-reset_status notifications to the nonstandard publisher_ids to which they were being sent. In Ussuri, these notifications were sent to both the old nonstandard publisher_ids and to the standard ones. The deprecation period is over, so remove the back-compat code and publish os-reset_status notifications only to the standard publisher ids. Change-Id: Iba64fcfbcb915e8ee8e58e4cf3058a973a7cf4fd Implements: bp os-reset-status-remove-back-compat --- cinder/api/contrib/admin_actions.py | 13 ------------- cinder/backup/manager.py | 6 ------ ...tatus-notification-update-b655615871db4659.yaml | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 19 deletions(-) create mode 100644 releasenotes/notes/reset-status-notification-update-b655615871db4659.yaml diff --git a/cinder/api/contrib/admin_actions.py b/cinder/api/contrib/admin_actions.py index eeebbe52287..30424e94ad6 100644 --- a/cinder/api/contrib/admin_actions.py +++ b/cinder/api/contrib/admin_actions.py @@ -29,7 +29,6 @@ from cinder import db from cinder import exception from cinder.i18n import _ from cinder import objects -from cinder import rpc from cinder import volume from cinder.volume import volume_utils @@ -101,12 +100,6 @@ class AdminController(wsgi.Controller): LOG.debug(msg, {'resource': self.resource_name, 'id': id, 'update': update}) - # calling notifier here for volumeStatusUpdate is deprecated. - # Will be replaced with _notify_reset_status() - notifier_info = dict(id=id, update=update) - notifier = rpc.get_notifier('volumeStatusUpdate') - notifier.info(context, self.collection + '.reset_status.start', - notifier_info) self._notify_reset_status(context, id, 'reset_status.start') # Not found exception will be handled at the wsgi level @@ -115,8 +108,6 @@ class AdminController(wsgi.Controller): if update.get('attach_status') == 'detached': _clean_volume_attachment(context, id) - notifier.info(context, self.collection + '.reset_status.end', - notifier_info) self._notify_reset_status(context, id, 'reset_status.end') @wsgi.response(http_client.ACCEPTED) @@ -310,10 +301,6 @@ class BackupAdminController(AdminController): LOG.debug(msg, {'resource': self.resource_name, 'id': id, 'update': update}) - notifier_info = {'id': id, 'update': update} - notifier = rpc.get_notifier('backupStatusUpdate') - notifier.info(context, self.collection + '.reset_status.start', - notifier_info) self._notify_reset_status(context, id, 'reset_status.start') # Not found exception will be handled at the wsgi level diff --git a/cinder/backup/manager.py b/cinder/backup/manager.py index ea2e44ae40e..05f2fa0f041 100644 --- a/cinder/backup/manager.py +++ b/cinder/backup/manager.py @@ -55,7 +55,6 @@ from cinder import manager from cinder import objects from cinder.objects import fields from cinder import quota -from cinder import rpc from cinder import utils from cinder.volume import rpcapi as volume_rpcapi from cinder.volume import volume_utils @@ -987,11 +986,6 @@ class BackupManager(manager.SchedulerDependentManager): "snapshots for backup %(bkup)s.", {'bkup': backup.id}) - # send notification to ceilometer - notifier_info = {'id': backup.id, 'update': {'status': status}} - notifier = rpc.get_notifier('backupStatusUpdate') - notifier.info(context, "backups.reset_status.end", - notifier_info) volume_utils.notify_about_backup_usage(context, backup, 'reset_status.end') diff --git a/releasenotes/notes/reset-status-notification-update-b655615871db4659.yaml b/releasenotes/notes/reset-status-notification-update-b655615871db4659.yaml new file mode 100644 index 00000000000..cdd668de7da --- /dev/null +++ b/releasenotes/notes/reset-status-notification-update-b655615871db4659.yaml @@ -0,0 +1,14 @@ +--- +upgrade: + - | + Prior to the Ussuri release, ``os-reset_status`` notifications for + volumes, snapshots, and backups were sent to *nonstandard* publisher_ids. + This behavior was deprecated in Ussuri, and notifications were sent to + both the standard and nonstandard publisher_ids. In this release, + ``os-reset_status`` notifications, like all other notifications for + volume, snapshot and backup, are sent *only* to the following + *standard* publisher_ids: + + * 'volume' for volume status resets + * 'snapshot' for snapshot status resets + * 'backup' for backup status resets