diff options
author | Mehdi Abaakouk <sileht@redhat.com> | 2015-12-01 10:27:23 +0100 |
---|---|---|
committer | Mehdi Abaakouk <sileht@redhat.com> | 2015-12-08 09:14:20 +0100 |
commit | 185f94c013442d87edcea3d81b133d26fdf8a945 (patch) | |
tree | 39a1cff898a1320f25aac62dc40b328e19a2e12d | |
parent | 4dd644ac201ee0fe247d648a2f735998416bf2c7 (diff) | |
download | oslo-messaging-185f94c013442d87edcea3d81b133d26fdf8a945.tar.gz |
notif: Check the driver features in dispatcher
The transport/driver features check is done into the get listener
methods.
So when these methods are not used the driver features checks is not
done.
This change moves it into the dispatcher layer to ensure the
requirements are always checked.
This changes a bit the behavior of when the check occurs. Before
it was during the listener object initialisation. Now this
when the listener server start.
Change-Id: I4d81a4e8496f04d62e48317829d5dd8b942d501c
-rw-r--r-- | oslo_messaging/notify/dispatcher.py | 1 | ||||
-rw-r--r-- | oslo_messaging/notify/listener.py | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/oslo_messaging/notify/dispatcher.py b/oslo_messaging/notify/dispatcher.py index afd34a2..7228767 100644 --- a/oslo_messaging/notify/dispatcher.py +++ b/oslo_messaging/notify/dispatcher.py @@ -56,6 +56,7 @@ class _NotificationDispatcherBase(dispatcher.DispatcherBase): priorities)) def _listen(self, transport): + transport._require_driver_features(requeue=self.allow_requeue) return transport._listen_for_notifications(self._targets_priorities, pool=self.pool) diff --git a/oslo_messaging/notify/listener.py b/oslo_messaging/notify/listener.py index 275da20..8855d58 100644 --- a/oslo_messaging/notify/listener.py +++ b/oslo_messaging/notify/listener.py @@ -137,7 +137,6 @@ def get_notification_listener(transport, targets, endpoints, :type pool: str :raises: NotImplementedError """ - transport._require_driver_features(requeue=allow_requeue) dispatcher = notify_dispatcher.NotificationDispatcher(targets, endpoints, serializer, allow_requeue, pool) @@ -180,7 +179,6 @@ def get_batch_notification_listener(transport, targets, endpoints, :type batch_timeout: int :raises: NotImplementedError """ - transport._require_driver_features(requeue=allow_requeue) dispatcher = notify_dispatcher.BatchNotificationDispatcher( targets, endpoints, serializer, allow_requeue, pool, batch_size, batch_timeout) |