Commit Graph

11 Commits

Author SHA1 Message Date
dengzhaosen 39826f06f1 Remove the oslo_utils.fnmatch
Oslo.utils's fnmatch module was added to fix the py2.7 fnmatch module
who was not thread safe [1]. Python 2.7 is no longer supported so now we
can use the stdlib's fnmatch module and deprecate the one of oslo.utils.

[1] https://bugs.python.org/issue23191$

Change-Id: Id5381a0a5216783f0df594b126786947db16a8d1
2021-05-11 01:02:11 +00: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
Li-zhigang ea8fad47a5 Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using six.iteritems to achieve iterators.
We can use dict.items instead, as it will return iterators in PY3 as well.
And dict.items/keys will more readable. 2.In py2, the performance about
list should be negligible, see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: Ia235afc3532f62f265f91ca46d2306c72fc2a2a2
2016-11-23 09:02:14 +00:00
ZhiQiang Fan 5b94b4b7a9 use thread safe fnmatch
fnmatch is not thread safe in python <2.7.10, let's use the safe
one in oslo.utils

Change-Id: If3d480436506ecc5f3c2fcbd51ceaac59f2b7dec
ref: https://hg.python.org/cpython/rev/fe12c34c39eb
2016-04-21 11:43:53 +08:00
Davanum Srinivas f8969e97ce [py34] replace file() with open()
Running flake8 with python3 finds this problem:
./oslo_messaging/notify/_impl_routing.py:55:16: F821 undefined name 'file'
        return file(filename, 'r')

Change-Id: I5cd7475618f7a7532db770c2c5c61576a657fbb4
2016-03-24 11:32:25 +00:00
Davanum Srinivas 33c1010c32 Option group for notifications
In change Ief6f95ea906bfd95b3218a930c9db5d8a764beb9, we 
decoupled RPC and Notifications a bit. We should take another
step and separate out the options for notifications into 
its own group.

Change-Id: Ib51e2839f9035d0cc0e3f459939d9f9003a8c810
2015-11-30 19:30:05 +00:00
Cyril Roelandt c4a7ac0b65 Use yaml.safe_load instead of yaml.load
We currently use yaml.load to read a user-written config file. This can
lead to malicious code execution, so we should use yaml.safe_load
instead.

Found using bandit.

Change-Id: I27792f0435bc3cb9b9d31846d07a8d47a1e7679d
2015-10-21 17:22:20 +02:00
Davanum Srinivas 1893c495f6 Allow custom notification drivers
Our class hierarchy hides classes and modules that so its hard
for folks to write a custom Notification driver. We should
make these public and document them

Closes-Bug: #1426046
Change-Id: Ifb96c2ae9868426cac2700bf4917c27c02c90b15
2015-09-25 10:07:05 -04:00
Davanum Srinivas 588d795b3c Use proper translating helper for logging
Add hacking rule borrowed from keystone to make sure
we don't regress and fix all the issues found by the
hacking check.

Change-Id: I41635fdd83c3e04d04f9849a72c49ccb5ac42875
2015-08-20 21:01:59 -04:00
Doug Hellmann ee31a84719 Update Oslo imports to remove namespace package
Change-Id: I4ec9b2a310471e4e07867073e9577731ac34027d
Blueprint: drop-namespace-packages
2015-01-21 21:09:33 -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