From e15cd36cd5d9150bde784d559fbaad882f5cfbfe Mon Sep 17 00:00:00 2001 From: Ilya Pekelny Date: Tue, 23 Sep 2014 10:52:19 +0300 Subject: [PATCH] Renamed PublishErrorsHandler For greater clarity, that the class is related to logging, PublishErrorsHandler renamed to LoggingErrorNotificationHandler. Included an alias from the old name to the new class for backwards-compatibility. Change-Id: Iae8e26901bab6d5aa7532add31b49a4345b067fe Closes-Bug: #1287420 --- doc/source/index.rst | 2 +- doc/source/notifier.rst | 2 +- oslo/messaging/notify/__init__.py | 3 ++- oslo/messaging/notify/log_handler.py | 5 ++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index d8646fcfb..fac9ac5fd 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -215,7 +215,7 @@ contributions to this release. Changes since 1.3.0a9: -* Expose PublishErrorsHandler in the public API +* Expose LoggingErrorNotificationHandler in the public API * 1288425_: Add kombu driver library to requirements.txt * 1255239_: Add unit tests for the qpid driver * 1261631_: Add unit test for Qpid reconnect order diff --git a/doc/source/notifier.rst b/doc/source/notifier.rst index ef5155348..cfd321850 100644 --- a/doc/source/notifier.rst +++ b/doc/source/notifier.rst @@ -10,5 +10,5 @@ Notifier .. autoclass:: LoggingNotificationHandler :members: -.. autoclass:: PublishErrorsHandler +.. autoclass:: LoggingErrorNotificationHandler :members: diff --git a/oslo/messaging/notify/__init__.py b/oslo/messaging/notify/__init__.py index 2ac72b0a9..c5032db83 100644 --- a/oslo/messaging/notify/__init__.py +++ b/oslo/messaging/notify/__init__.py @@ -17,7 +17,8 @@ __all__ = ['Notifier', 'LoggingNotificationHandler', 'get_notification_listener', 'NotificationResult', - 'PublishErrorsHandler'] + 'PublishErrorsHandler', + 'LoggingErrorNotificationHandler'] from .notifier import * from .listener import * diff --git a/oslo/messaging/notify/log_handler.py b/oslo/messaging/notify/log_handler.py index cd5251bfe..0889a1301 100644 --- a/oslo/messaging/notify/log_handler.py +++ b/oslo/messaging/notify/log_handler.py @@ -15,7 +15,7 @@ import logging from oslo.config import cfg -class PublishErrorsHandler(logging.Handler): +class LoggingErrorNotificationHandler(logging.Handler): def __init__(self, *args, **kwargs): # NOTE(dhellmann): Avoid a cyclical import by doing this one # at runtime. @@ -36,3 +36,6 @@ class PublishErrorsHandler(logging.Handler): return self._notifier.error(None, 'error_notification', dict(error=record.msg)) + + +PublishErrorsHandler = LoggingErrorNotificationHandler