diff --git a/oslo/messaging/notify/notifier.py b/oslo/messaging/notify/notifier.py index e287f9f84..115df2858 100644 --- a/oslo/messaging/notify/notifier.py +++ b/oslo/messaging/notify/notifier.py @@ -170,6 +170,18 @@ class Notifier(object): if self._driver_mgr.extensions: self._driver_mgr.map(do_notify) + def audit(self, ctxt, event_type, payload): + """Send a notification at audit level. + + :param ctxt: a request context dict + :type ctxt: dict + :param event_type: describes the event, e.g. 'compute.create_instance' + :type event_type: str + :param payload: the notification payload + :type payload: dict + """ + self._notify(ctxt, event_type, payload, 'AUDIT') + def debug(self, ctxt, event_type, payload): """Send a notification at debug level. diff --git a/tests/test_notifier.py b/tests/test_notifier.py index f75a63432..162b19511 100644 --- a/tests/test_notifier.py +++ b/tests/test_notifier.py @@ -99,6 +99,7 @@ class TestMessagingNotifier(test_utils.BaseTestCase): ] _priority = [ + ('audit', dict(priority='audit')), ('debug', dict(priority='debug')), ('info', dict(priority='info')), ('warn', dict(priority='warn')),