diff --git a/oslo/messaging/notify/__init__.py b/oslo/messaging/notify/__init__.py index 92d726ba7..2ac72b0a9 100644 --- a/oslo/messaging/notify/__init__.py +++ b/oslo/messaging/notify/__init__.py @@ -16,9 +16,11 @@ __all__ = ['Notifier', 'LoggingNotificationHandler', 'get_notification_listener', - 'NotificationResult'] + 'NotificationResult', + 'PublishErrorsHandler'] from .notifier import * from .listener import * +from .log_handler import * from .logger import * from .dispatcher import NotificationResult diff --git a/oslo/messaging/notify/log_handler.py b/oslo/messaging/notify/log_handler.py index 679eb69d5..cd5251bfe 100644 --- a/oslo/messaging/notify/log_handler.py +++ b/oslo/messaging/notify/log_handler.py @@ -13,11 +13,13 @@ import logging from oslo.config import cfg -from oslo import messaging class PublishErrorsHandler(logging.Handler): def __init__(self, *args, **kwargs): + # NOTE(dhellmann): Avoid a cyclical import by doing this one + # at runtime. + from oslo import messaging logging.Handler.__init__(self, *args, **kwargs) self._transport = messaging.get_transport(cfg.CONF) self._notifier = messaging.Notifier(self._transport,