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
This commit is contained in:
Brian Rosmaita 2020-08-22 15:35:38 -04:00
parent 57411ae7c9
commit ecdd7522e8
3 changed files with 14 additions and 19 deletions

View File

@ -29,7 +29,6 @@ from cinder import db
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder import objects from cinder import objects
from cinder import rpc
from cinder import volume from cinder import volume
from cinder.volume import volume_utils from cinder.volume import volume_utils
@ -101,12 +100,6 @@ class AdminController(wsgi.Controller):
LOG.debug(msg, {'resource': self.resource_name, 'id': id, LOG.debug(msg, {'resource': self.resource_name, 'id': id,
'update': update}) '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') self._notify_reset_status(context, id, 'reset_status.start')
# Not found exception will be handled at the wsgi level # Not found exception will be handled at the wsgi level
@ -115,8 +108,6 @@ class AdminController(wsgi.Controller):
if update.get('attach_status') == 'detached': if update.get('attach_status') == 'detached':
_clean_volume_attachment(context, id) _clean_volume_attachment(context, id)
notifier.info(context, self.collection + '.reset_status.end',
notifier_info)
self._notify_reset_status(context, id, 'reset_status.end') self._notify_reset_status(context, id, 'reset_status.end')
@wsgi.response(http_client.ACCEPTED) @wsgi.response(http_client.ACCEPTED)
@ -310,10 +301,6 @@ class BackupAdminController(AdminController):
LOG.debug(msg, {'resource': self.resource_name, 'id': id, LOG.debug(msg, {'resource': self.resource_name, 'id': id,
'update': update}) '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') self._notify_reset_status(context, id, 'reset_status.start')
# Not found exception will be handled at the wsgi level # Not found exception will be handled at the wsgi level

View File

@ -55,7 +55,6 @@ from cinder import manager
from cinder import objects from cinder import objects
from cinder.objects import fields from cinder.objects import fields
from cinder import quota from cinder import quota
from cinder import rpc
from cinder import utils from cinder import utils
from cinder.volume import rpcapi as volume_rpcapi from cinder.volume import rpcapi as volume_rpcapi
from cinder.volume import volume_utils from cinder.volume import volume_utils
@ -987,11 +986,6 @@ class BackupManager(manager.SchedulerDependentManager):
"snapshots for backup %(bkup)s.", "snapshots for backup %(bkup)s.",
{'bkup': backup.id}) {'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, volume_utils.notify_about_backup_usage(context, backup,
'reset_status.end') 'reset_status.end')

View File

@ -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