Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-virt / recipes-extended / ceph / ceph-14.1.0 / rados.runtime.decode.error.patch
1 diff -Nurpd a/src/pybind/rados/rados.pyx b/src/pybind/rados/rados.pyx
2 --- a/src/pybind/rados/rados.pyx        2020-04-11 17:15:00.793220981 -0700
3 +++ b/src/pybind/rados/rados.pyx        2020-04-11 17:18:32.536405851 -0700
4 @@ -326,7 +326,10 @@ LIBRADOS_OPERATION_IGNORE_CACHE = _LIBRA
5  LIBRADOS_OPERATION_SKIPRWLOCKS = _LIBRADOS_OPERATION_SKIPRWLOCKS
6  LIBRADOS_OPERATION_IGNORE_OVERLAY = _LIBRADOS_OPERATION_IGNORE_OVERLAY
7  
8 -LIBRADOS_ALL_NSPACES = _LIBRADOS_ALL_NSPACES.decode('utf-8')
9 +if isinstance(_LIBRADOS_ALL_NSPACES, str):
10 +    LIBRADOS_ALL_NSPACES = _LIBRADOS_ALL_NSPACES
11 +else:
12 +    LIBRADOS_ALL_NSPACES = _LIBRADOS_ALL_NSPACES.decode('utf-8')
13  
14  LIBRADOS_CREATE_EXCLUSIVE = _LIBRADOS_CREATE_EXCLUSIVE
15  LIBRADOS_CREATE_IDEMPOTENT = _LIBRADOS_CREATE_IDEMPOTENT
16 diff --git a/src/pybind/rados/rados.pyx b/src/pybind/rados/rados.pyx
17 index fe17620..beca5ae 100644
18 --- a/src/pybind/rados/rados.pyx
19 +++ b/src/pybind/rados/rados.pyx
20 @@ -555,6 +555,8 @@ def decode_cstr(val, encoding="utf-8"):
21      """
22      if val is None:
23          return None
24 +    if isinstance(val, str):
25 +        return val
26
27      return val.decode(encoding)