Sofia Enriquez a9c4bfab35 Fix json to_primitive when using IO OBjects
Currently, using Cinder's backup service with RBD the
backup-create operation gets stuck when logging
('use_json=True' must be set in the config file).

The oslo.log JSONFormatter gets stuck when passing an
RBDVolumeIOWrapper from os-brick. This happens via os-brick's
utils.trace() method which passes a connector containing
{'path': RBDVolumeIOWrapper}.
The oslo.log JSONFormatter format() method calls
oslo_serialization's jsonutils.to_primitive and passes in
this RBDVolumeIOWrapper object.
 
Therefore the to_primitive method eventually calls
RBDVolumeIOWrapper.read(). In order to fix this the current
path avoids mapping io.IOBase objects and fallback the wrapper
RBD volume object.

Co-authored-by: Eric Harney <eharney@redhat.com>
Closes-Bug: #1908607
Change-Id: I3c416e855cb5f0dc32d14b2749ba92aba8964574
(cherry picked from commit 02037330d8)
(cherry picked from commit fcd737e2b1)
(cherry picked from commit ab5c68d301)
2021-02-05 10:25:48 +01:00
2019-09-20 16:37:33 +00:00
2018-07-04 08:23:05 +07:00
2019-07-05 15:01:51 -04:00
2019-02-17 10:28:24 +08:00
2017-03-03 00:03:20 +00:00

Team and repository tags

image

oslo.serialization

Latest Version

Downloads

The oslo.serialization library provides support for representing objects in transmittable and storable formats, such as Base64, JSON and MessagePack.

Description
OpenStack library for serialization
Readme 3.4 MiB
Languages
Python 100%