Commit Graph

8 Commits

Author SHA1 Message Date
Victor Stinner bb4121a465 Revert "Ensure the json result type is bytes on Python 3"
This reverts commit bd81d09c02.

I understand that the change was supposed to fix something, but instead it broke all tests on Python 3!?

It's wrong to replace blindly json.dumps() with jsonutils.dump_as_bytes(). In oslo messaging, the result is usually used as a value in a dictionary, and then the whole dictionary is passed to a second serializer which also serialize to JSON.

Sorry, I don't understand everything, but at least I see that tests passed on py3 before the change, and started to fail with the change.

Maybe json(utils).dumps() is misused in some places, but in this case, you should write a change which only fix these specific places, not replace all calls to dumps().

Change-Id: Icd54ee8e3f5c976dfd50b4b62c7f51288649e112
2016-03-11 09:00:08 +00:00
Javeme bd81d09c02 Ensure the json result type is bytes on Python 3
Since the json.dumps() returns Unicode string On Python 3, to
ensure that the result type is bytes on Python 2 and Python 3
that if the result is used for the message body, let's replace
    json.dumps() /  oslo_serialization.jsonutils.dumps()
with
    oslo_serialization.jsoutils.dump_as_bytes()

Change-Id: I0e0f6b715ffc4a9ad82be52e55696d032b6d0976
2016-02-24 15:20:08 +08:00
Javeme 3288c4d7e2 Use more efficient mask_dict_password to mask password
The mask_dict_password method is added from oslo_utils 3.4.0, and it's
about five times faster than the mask_password method, so it's better
to use mask_dict_password instead of mask_password.

Change-Id: I6629ed1232f2e6f1c72b9f13b361e2f9e14b50a4
2016-02-24 13:19:53 +08:00
Davanum Srinivas 6dba2ed591 Add Warning when we cannot notify
Calling Notifier.audit() won't work with LogDriver as the
logger does not have a audit level anymore, So let's at
least not fail silently and let the operators know that
we are dropping stuff on the floor.

Closes-Bug: #1518170
Change-Id: I74002c72e6763ea8b5df7d97d722619bd4a1950b
2015-11-24 02:08:07 +00: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
Ryan Rossiter c990ee02fa Mask passwords when logging messages
When logging a message, any secrets and passwords should be masked. This
uses oslo_utils.strutils to mask any passwords that are to be logged.

Change-Id: I263d44c0f2e900c5f6e210cbd7ec56e48d0d5bb2
Closes-Bug: #1487038
2015-08-24 13:13:44 +00: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