diff --git a/doc/source/event_notifications.rst b/doc/source/event_notifications.rst index 740986b1d2..7011e16c12 100644 --- a/doc/source/event_notifications.rst +++ b/doc/source/event_notifications.rst @@ -365,7 +365,7 @@ the unique identifier of the resource type. .. code-block:: javascript { - "event_type": "identity.created.role_assignment", + "event_type": "identity.role_assignment.created", "message_id": "a5901371-d5fd-b3bb-448f-a14dead6f4cb", "payload": { "typeURI": "http://schemas.dmtf.org/cloud/audit/1.0/event", diff --git a/keystone/notifications.py b/keystone/notifications.py index 4f2fbe1c87..55c9cb31ac 100644 --- a/keystone/notifications.py +++ b/keystone/notifications.py @@ -22,7 +22,6 @@ import socket from oslo_config import cfg from oslo_log import log -from oslo_log import versionutils import oslo_messaging import pycadf from pycadf import cadftaxonomy as taxonomy @@ -573,8 +572,6 @@ class CadfRoleAssignmentNotificationWrapper(object): def __init__(self, operation): self.action = '%s.%s' % (operation, self.ROLE_ASSIGNMENT) - self.deprecated_event_type = '%s.%s.%s' % (SERVICE, operation, - self.ROLE_ASSIGNMENT) self.event_type = '%s.%s.%s' % (SERVICE, self.ROLE_ASSIGNMENT, operation) @@ -632,30 +629,19 @@ class CadfRoleAssignmentNotificationWrapper(object): audit_kwargs['inherited_to_projects'] = inherited audit_kwargs['role'] = role_id - # For backward compatibility, send both old and new event_type. - # Deprecate old format and remove it in the next release. - event_types = [self.deprecated_event_type, self.event_type] - versionutils.deprecated( - as_of=versionutils.deprecated.KILO, - remove_in=+1, - what=('sending duplicate %s notification event type' % - self.deprecated_event_type), - in_favor_of='%s notification event type' % self.event_type) try: result = f(wrapped_self, role_id, *args, **kwargs) except Exception: - for event_type in event_types: - _send_audit_notification(self.action, initiator, - taxonomy.OUTCOME_FAILURE, - target, event_type, - **audit_kwargs) + _send_audit_notification(self.action, initiator, + taxonomy.OUTCOME_FAILURE, + target, self.event_type, + **audit_kwargs) raise else: - for event_type in event_types: - _send_audit_notification(self.action, initiator, - taxonomy.OUTCOME_SUCCESS, - target, event_type, - **audit_kwargs) + _send_audit_notification(self.action, initiator, + taxonomy.OUTCOME_SUCCESS, + target, self.event_type, + **audit_kwargs) return result return wrapper