Commit Graph

69 Commits

Author SHA1 Message Date
Doug Hellmann 03265410e0 Remove oslo namespace package
Blueprint remove-namespace-packages

Depends-on: I2eeef93ee2e61a721c69f62add819f93f62f077d
for openstack/ceilometer
Depends-on: I26390dd908769be5f1a5b70be22d3b98e3a45563
for openstack/ceilometermiddleware
Depends-on: Ifa8baab33cdb3e606cf175a8c29c3a4ef6c44480
for openstack/glance
Depends-on: I029c3260051aa48cfaae428c096c1ac7b43b2bd2
for openstack/ceilometermiddleware

Change-Id: I8c5595bbafa82db33f62fa47d214f5cb756a2639
2015-07-16 17:47:16 +00:00
Doug Hellmann eb9251173c Expose _impl_test for designate
The previous attempt to do this in
Ide40b293c9b9c76aae094950720cead4179ea883 created a new module
oslo/messaging/notify/_impl_test.py which imported the symbols from
oslo_messaging/notify/_impl_test.py. That doesn't actually work, because
the functions to reset the notifications modify the copy of the symbol
in the oslo_messaging package, but the designate tests are still looking
at the copy in oslo/messaging.

This change imports a copy of the module from oslo_messaging in the
oslo/messaging namespace to make certain that the same module object,
and therefore the same global data structure, is used no matter which
path the code is accessed.

The designate team still needs to fix their fixture, but this will let
us release oslo.messaging without breaking their tests in the mean time.

Partial-Bug: #1412812

Change-Id: I629ac57ae1e74bb07e5e98ee2fbc21f8421c3c24
2015-01-26 21:55:20 +00:00
Doug Hellmann 76808973c3 Add more private symbols to the old namespace package
This patch exposes some private symbols used by the tests in nova and
heat.

Change-Id: Ide40b293c9b9c76aae094950720cead4179ea883
Partial-Bug: #1412812
Partial-Bug: #1412841
2015-01-20 22:22:14 +00:00
Doug Hellmann e55a83e832 Move files out of the namespace package
Move the public API out of oslo.messaging to oslo_messaging. Retain
the ability to import from the old namespace package for backwards
compatibility for this release cycle.

bp/drop-namespace-packages

Co-authored-by: Mehdi Abaakouk <mehdi.abaakouk@enovance.com>
Change-Id: Ia562010c152a214f1c0fed767c82022c7c2c52e7
2015-01-12 12:50:41 -05:00
Jenkins 1949c7641d Merge "Add an optional executor callback to dispatcher" 2015-01-06 20:54:25 +00:00
Mehdi Abaakouk d3e6ea1788 Warns user if thread monkeypatch is not done
This change warns the user that it does have monkeypatched the
oslo.messaging library correclty.

Change-Id: Ice80ffc6cbc39919eac4bc0809992daea51b5922
Closes-bug: #1288878
2014-12-10 15:59:59 +01:00
Victor Stinner 0844037fad Add an optional executor callback to dispatcher
The callback will be used in the new aiogreen executor to support
trollius coroutines.

The change includes an unit test.

Change-Id: I556b112371bec2ec29cea4dc254bb3f9c6d2c07a
2014-12-03 01:45:17 +01:00
Jenkins b631f46c7f Merge "Renamed PublishErrorsHandler" 2014-11-27 22:03:54 +00:00
Ilya Pekelny e15cd36cd5 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
2014-11-27 16:04:07 +02:00
Mehdi Abaakouk 30e0aea877 Notification listener pools
We can now set the pool name of a notification listener
to create multiple groups/pools of listeners consuming notifications
and that each group/pool only receives one copy of each notification.

The AMQP implementation of that is to set queue_name with the pool name.

Implements blueprint notification-listener-pools
Closes-bug: #1356226

Change-Id: I8dc0549f5550f684a261c78c58737b798fcdd656
2014-11-14 10:20:18 +01:00
Julien Danjou 10eb1202b3 Switch to oslo.middleware
Change-Id: I35f76724768c163b57728914f0ed700f1bc13e29
2014-11-08 18:08:37 +01:00
Julien Danjou 3dd6a23271 Finish transition to oslo.i18n
Change-Id: Ia0c8c15ba95b1fac6c815b86ccd8771b3ca24327
2014-10-06 13:28:05 +02:00
Davanum Srinivas 487bbf5b13 Enable oslo.i18n for oslo.messaging
Change-Id: Ic8e05ae4ffe3eb871ae64243c41a9955f47cbe2a
2014-09-24 22:18:50 -04:00
Julien Danjou 8d242bd7ab Switch to oslo.serialization
Change-Id: I24be947cfc2d9ce60e65054e6562e544b1e21195
2014-09-23 14:54:30 +02:00
Julien Danjou f8ea1a0f76 Import notifier middleware from oslo-incubator
Blueprint: graduate-notifier-middleware

Change-Id: I2aa341f3e96a7344b87160609fb47e43bae5b245
2014-09-08 16:27:27 -04:00
Julien Danjou a9ec73f38d Switch to oslo.utils
Change-Id: I262e98d8d03acbe2ff8fee5d607279a669a89e34
2014-08-27 14:14:00 +02:00
Christian Berendt 8151da821b Enable PEP8 check E241
* E241 multiple spaces after ':'

Change-Id: I2310ffc00b7fe58d0781705a73212eefa116c999
2014-08-08 06:06:55 +00:00
Christian Berendt 5be1b6a6a9 Enabled hacking checks H305 and H307
* H305  imports not grouped correctly
* H307  like imports should be grouped together

Change-Id: I08dafc4fa150d2213b2bb002da7c9ee0ee517fac
2014-07-17 12:41:21 +02:00
Christian Berendt 59103984bb Replaced 'e.g.' with 'for example'
According to the IBM Style Guide the Latin abbreviation 'e.g.'
should be replace by 'for example'.

Change-Id: I694df5ed62213e29bdf35f781fd6f310b7df77a6
2014-07-06 20:56:11 +02:00
Jenkins 555eb7980b Merge "Fix the notifier example" 2014-06-28 18:05:15 +00:00
Aaron Rosen 0102aa96e6 Replace usage of str() with six.text_type
Replace using of str with six.text_type as it's able to
handle unicode data.

Change-Id: I38e4378c490d1dad8020312308dd3b6dad8772c0
2014-06-25 20:08:51 +00:00
Gauvain Pocentek 244a90278b Fix the notifier example
The notifier should be instantiated using messaging.Notifier, not
notifier.Notifier.

Change-Id: Id1930df6b758b292a7591e2e4cba2ef5a313a3cb
2014-06-22 09:47:02 +02:00
Christian Berendt 409108c74f replace string format arguments with function parameters
There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.

Change-Id: I4a7ce6916aefb2f2d445f0ebd977c824b1c51e24
Partial-Bug: #1321274
2014-06-20 14:18:40 +01:00
Mehdi Abaakouk 1ea9c35ab4 Transport reconnection retries for notification
This patch add support of reconnection retries for the
messaging notifier.

Related bug #1282639
Change-Id: Ia30331f8306ff0f6952d83ef42ff8bee6b900427
2014-06-18 18:41:33 +02:00
Mehdi Abaakouk cbbb90e28c Fix the notify method of the routing notifier
The notify method of the routing notifier don't have the correct
signature and change the case of the priority.

This change fixes it.

Change-Id: I833b19d0c054c94b861a4f6cc263c3487fa0e544
Closes-bug: #1316681
2014-06-16 16:18:37 +02:00
Christian Berendt a6200c0a00 debug level logs should not be translated
According to the OpenStack translation policy available at
https://wiki.openstack.org/wiki/LoggingStandards debug messages
should not be translated. Like mentioned in several changes in
Nova by garyk this is to help prioritize log translation.

Change-Id: I4af4a45a56b1364a2f5196b75cff299d607ab393
Partial-Bug: #1317950
2014-05-20 22:57:36 +02:00
ChangBo Guo(gcb) f62ca58667 Fix typo in docstring of notify/notifier
Change-Id: Idd9f60e4d7ba65157f82f2a4c128f63c3ad6e805
2014-04-22 23:33:31 +08:00
Jenkins 5f5501f534 Merge "notify listener: document the metadata callback parameter" 2014-03-10 14:27:32 +00:00
Doug Hellmann 7a6f5054fd Expose PublishErrorsHandler through oslo.messaging
Fix up the imports so that the log handler for publishing
error messages is available through the oslo.messaging
package instead of users having to know the full path
inside the sub-module.

Change-Id: I5c8ddaf451f7c977d8c400fe920512cdafbc7fdf
2014-03-03 15:21:28 -08:00
Jenkins 8cccf06c65 Merge "notification listener: add allow_requeue param" 2014-03-03 20:49:54 +00:00
Mark McLoughlin 8060878b5b notify listener: document the metadata callback parameter
Add some details about what the metadata parameter contains.

Change-Id: I191c1c480c679534c1dede9aa85c51615faf0800
2014-03-03 09:43:21 -08:00
Mehdi Abaakouk ed2a1545c0 Add missing data into the notif. endpoint callback
Some information about the notification (ie: message_id and timestamp)
are currently not available for the application.

This change add them.

Partial implements blueprint notification-subscriber-server

Change-Id: I83e562725205fb270f6065fe1118c3c9865b2294
2014-03-03 17:33:41 +01:00
Mark McLoughlin 5bd31315c2 notification listener: add allow_requeue param
In commit d8d2ad9 we added support for notification listener endpoint
methods to return REQUEUE, but if a driver does not support this we
raise NotImplementedError when the application attempts to requeue
a message.

This requeuing behaviour might only be used by an application in
unusual, exceptional circumstances and catch users by surprise.

Instead, let's require the application to assert that it needs this
feature in advance and raise NotImplementError at that point if the
driver doesn't support it.

Change-Id: Id0bb0e57d2dcc1ec7d752e98c9b1e8e48d99f35c
2014-03-03 07:51:18 -08:00
Mehdi Abaakouk d8d2ad95d7 Allow to requeue the notification message
This patch allow to requeue the notification received by the
notification listener.

Partial implements blueprint notification-subscriber-server

Change-Id: I49c4ba91224c280e479edb19289ccb337a2ab843
2014-03-03 09:27:57 +01:00
Jenkins 14e3aeb3da Merge "Add log_handler to oslo.messaging" 2014-02-25 16:51:54 +00:00
Jenkins e9821fe602 Merge "Improve help strings" 2014-02-25 12:40:18 +00:00
Lance Bragstad 78ff56e170 Add log_handler to oslo.messaging
Move log_handler from oslo-incubator to oslo.messaging and include
unit tests. This patch also adds an additional test case from the
original version in oslo-incubator. Originally, the test case only
checked to make sure the notification was not sent. Now a positive test
case exists to test both paths.

bp graduate-notifier-log-handler
Co-Authored By: Ben Nemec <bnemec@redhat.com>

Change-Id: I9ea051ec7e3614579341a31d8dc1c13d9514b8a9
2014-02-21 22:41:37 +00:00
Mehdi Abaakouk e785a5d994 Make the dispatcher responsible of the message ack
This patch make the dispatcher responsible of the message
acknowledgement.

This is the preliminar step to be able to requeue message.

Partial implements blueprint notification-subscriber-server

Change-Id: If74b47d5e23976d407deb27df7395b1982963c75
2014-02-18 08:31:30 +01:00
Mehdi Abaakouk 8a644c1166 Don't reply to notification message
The notification listener doesn't have anything to send to the notifier
and the notifier doesn't attend to receive something.

So this patch remove the message reply when the listener is a
notification
listener.

Partial implements blueprint notification-subscriber-server

Change-Id: Ic989947ba3b6894cde788422842fca19159ea261
2014-02-18 08:31:30 +01:00
Mehdi Abaakouk 9f58e2c3fe Implements notification listener and dispatcher
This patch allows to quickly create a listener to receive
notification messages.

Example of the api:

class Endpoint(object):
    def warn(self, ctxt, publisher_id, event_type, payload):
        do_something(payload)

target = messaging.Target(topic='notifications', exchange='cinder')
listener = notify.get_notification_listener(transport, [target],
                                            [Endpoint()],
                                            executor,
                                            serializer)

Implements blueprint notification-subscriber-server

Change-Id: I434bc487c382a2048670df726d9bebd640150bb9
2014-02-14 16:06:26 +01:00
Andreas Jaeger 5a860beb87 Improve help strings
Follow oslo.config style guide for help strings better to create
consistent help strings:
* Capitalize first word of each help string
* Finish help strings with "."

Change-Id: Ia08fa09593661e6e5b834d98bbd92689c2674075
2014-02-07 22:25:09 +01:00
Sandy Walsh 30c9334306 Routing notifier
Takes a yaml-based config file
(see etc/oslo/routing_notifier.yaml.sample) via
routing_notifier_config option.

Events may be routed by priority or event_type.

Implements: blueprint configurable-notification
Change-Id: I437dfac348f387044e6da3d6a0bbb208323c1741
2014-01-15 04:08:18 +00:00
Sandy Walsh 43884bfbb4 Add Sample priority
With the routing notifier we can now issue high-frequency notifications
and not worry about clogging up the queue. The Sample priority will
be used for this situation.

Change-Id: Ia4aa77b7aa4ca9458e97ca3ed81101d92934b691
2013-12-17 15:47:42 +00:00
Jenkins 86b0750f3e Merge "Avoid storing configuration in notifier" 2013-11-29 20:58:14 +00:00
Julien Danjou 41c629dc03 Avoid storing configuration in notifier
The notifier itself doesn't use the configuration. So let's not store
it, that lights the dependency a bit on this configuration object.

Blueprint: messaging-decouple-cfg

Change-Id: Ic4b5ddd93ea0382bd8292f9e31b7dacba9b489d3
2013-11-29 17:51:41 +01:00
Julien Danjou f9ab2e105f Implement a log handler using notifier
Change-Id: Iccac043d46a733e965b3310bbbe9c7d6c07a46ac
Blueprint: logging-and-notification
2013-11-29 16:15:09 +01:00
Julien Danjou 010163d8ee notifier: add audit level
This maps what is provided by the openstack.common.logging module.

Change-Id: Id581c4c748e2763a2c9a3e576e3bd497595adbff
2013-11-29 14:47:03 +01:00
Julien Danjou 5912b58233 Add 'warning' as an alias to 'warn'
The standard Python logging system uses 'warning' and not 'warn'. To
ease compatibility with it, let's add 'warning' too.

Change-Id: I7778d7960ca7a72be007cb083e5434ede6e3fe6e
2013-11-27 10:39:19 +01:00
Chang Bo Guo c98d7edef8 Decouple from Oslo uuidutils module
uuidutils module will be deprecated in Icehouse, So need replace it.
This patch uses str(uuid.uuid4()) instead of method generate_uuid.

Closes-Bug: #1253497
Change-Id: I35815544429c489096b4db3fa79a649f4cd9459f
2013-11-22 19:59:03 -08:00
Davanum Srinivas 5f760096d6 Apply six for metaclass
__metaclass__ cannot be used in python3.six be used in general
for python 3 compatibility.

Porting Change-Id I9fc7a59df3af29b4cc1287c40fa4e883d994a961
from oslo-incubator

Change-Id: Icdacdcf5556b6d3b8450d1350c6f62b4f5a9690b
2013-10-14 14:10:31 -04:00