Commit Graph

16 Commits

Author SHA1 Message Date
Andreas Jaeger e44c988306 Remove six usage
Remove six, the python 2/3 compatibility library. It's not needed
anymore since the repo is python3 only.

Remove a now unneeded hacking test.

Change-Id: I40522c4accb4aaf8115d11fee8b081e2d991cb4d
2020-05-11 10:21:58 +02:00
Hervé Beraud 4f385720d7 Remove log translation and i18n
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

Change-Id: I9ddb6595fc52e46ed8844e39d2fa71029c90b65c
Closes-Bug: #1674567
2019-04-24 11:55:38 +02:00
Zuul c7eb5cac66 Merge "sort when using groupby" 2017-11-29 19:43:46 +00:00
gord chung 7c65038e79 don't convert generator to list unless required
there's only one scenario where the generator actually needs to be
forced into a list. don't waste time doing something unnecessary.

Change-Id: Iec897b1f6fed3d88b798eb673779e7c68ff930ec
2017-11-27 13:41:31 -05:00
gord chung b8a686fc52 sort when using groupby
groupby requires items to be sorted as it's clumping consecutive
items together. also, just use itemgetter instead of lambda

Change-Id: I1676fc60ebc2c9ff03ea00cc67061fdfb3b50868
2017-11-26 10:46:58 -05:00
Mehdi Abaakouk 5dd059aa3c Remove deprecated localcontext
Change-Id: Ib109ced5ee6a706853b0f54be6756cfaf63e2164
2016-05-18 09:28:15 +02:00
Dmitriy Ukhlov 990d894eaf Move server related logic from dispatchers
Dispatcher should be responsible for routing message to the
callback method of endpoint object and returning result back to the
server only. But now it is also responsible for sending reply,
ack/reque messages etc.

Also this patch makes small improvements:
   1) Notification dispatcher now requeue message if endpoint raises exception
   2) unstable behaviour of test_mask_passwords test is fixed

Change-Id: I5f23e23644e90919cb67f81fc306ee85c5e09974
2016-03-30 11:07:32 +00:00
Victor Stinner 22fea728cc Remove executor callback
Revert the change I556b112371bec2ec29cea4dc254bb3f9c6d2c07a: the
executor callback API was only used by the aioeventlet executor which
was just removed.

Change-Id: I1223f32594d8c1be28cc43fdd9bf102c86d75325
2016-02-18 12:50:44 +01:00
ChangBo Guo(gcb) 6b20fa8597 Improvement of logging acorrding to oslo.i18n guideline
1. Use translation marker functions, their argument must just be a string
2. Any message with more than one variable should use named
   interpolation instead of positional to allow translators
   to move the variables around in the string to account for
   differences in grammar and writing direction.
3. String interpolation should be delayed to be handled by the logging
   code, rather than being done at the point of the logging call.
For more details, please refert to oslo.i18n guideline [1]

Note: this commit doesn't touch test code.

[1] http://docs.openstack.org/developer/oslo.i18n/guidelines.html

Change-Id: I5f013d65b20396bbe0e5a2cceaed2a33fad1af23
2016-01-07 13:26:55 +08:00
Mehdi Abaakouk 185f94c013 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
2015-12-08 09:14:20 +01:00
Mehdi Abaakouk 4dd644ac20 batch notification listener
Gnocchi performs better if measurements are write in batch
When Ceilometer is used with Gnocchi, this is not possible.

This change introduce a new notification listener that allows that.

On the driver side, a default batch implementation is provided.
It's just call the legacy poll method many times.

Driver can override it to provide a better implementation.
For example, kafka handles batch natively and take benefit of this.

Change-Id: I16184da24b8661aff7f4fba6196ecf33165f1a77
2015-12-08 09:14:20 +01:00
Mehdi Abaakouk bdf287e847 creates a dispatcher abstraction
This change creates a dispatcher abstraction
to document the interface of a dispatcher.

And also allows in the futur to have attributes with default values.

Change-Id: I9a7e5e03f89635a3790b3851f492a1a7aab58feb
2015-12-07 16:43:34 +01:00
Mehdi Abaakouk c49594a62f Remove usage of contentmanager for executors
The context manager in the executor fit only for the blocking executor.
Even the dispatcher needs to run code before and after the application
callback, eventlet and future executors have to run the pre/post code
into the main thread and can run the callback into an other thread,
and that force them to run __enter__ and __exit__ manually and deal
the exception path.

This change adds a helper object instead of the context manager.
It is designed to be explicit on what must be executed
before and after the callback and what can be done in a thread or not.

All the executor code is now in the impl_pooledexecutor.py
and use the futures "PoolExecutor" API.

This use futurist to provide a eventlet and aioeventlet futures friendly
object.

Change-Id: I8cd7640f36beeda47560e3c82671bad3530e38d1
2015-07-08 13:42:10 +02:00
Mehdi Abaakouk 01247563f1 Deprecates the localcontext API
We deprecate the localcontext API in favor of the
oslo.context one.

Related bug: #1288878

Change-Id: If6049544e35ae49e41f2771cae858b6d4ebe00cd
2015-03-11 16:14:50 +01:00
Mehdi Abaakouk 3d232a0f38 Implements notification-dispatcher-filter
The NotificationFilter class is used to filter notifications that a
notification listerner endpoint will received.

The notification can be filtered on different fields: context,
publisher_id, event_type, metadata, and payload

DocImpact
Implements: blueprint notification-dispatcher-filter
Change-Id: Ic1239422fac9879b113c9d3d6c3f8dccef20d044
2015-01-13 09:44:23 -05: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