From 010163d8eec0905d510bba851a8ed55c1863ca2e Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 27 Nov 2013 11:48:09 +0100 Subject: [PATCH] notifier: add audit level This maps what is provided by the openstack.common.logging module. Change-Id: Id581c4c748e2763a2c9a3e576e3bd497595adbff --- oslo/messaging/notify/notifier.py | 12 ++++++++++++ tests/test_notifier.py | 1 + 2 files changed, 13 insertions(+) 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')),