summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-03-05 15:52:04 +0000
committerGerrit Code Review <review@openstack.org>2020-03-05 15:52:04 +0000
commit7cad6da6f1d4f7e8e47e6d1087d3905d3d806db6 (patch)
tree299da60c07763eeb93576dec7c081674a36bdba3
parentff65eec040f7c855aa53018489548e6e70f41346 (diff)
parent7880a5bfa7639fd6aa07d96b32da594c76940e38 (diff)
downloadglance_store-stable/rocky.tar.gz
Merge "Fix python3 compatibility of rbd get_fsid" into stable/rockyrocky-em0.26.2stable/rocky
-rw-r--r--glance_store/_drivers/rbd.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/glance_store/_drivers/rbd.py b/glance_store/_drivers/rbd.py
index 74e929b..9d48661 100644
--- a/glance_store/_drivers/rbd.py
+++ b/glance_store/_drivers/rbd.py
@@ -24,6 +24,7 @@ import logging
import math
from oslo_config import cfg
+from oslo_utils import encodeutils
from oslo_utils import units
from six.moves import urllib
@@ -469,7 +470,18 @@ class Store(driver.Store):
rados_id=self.user) as conn:
fsid = None
if hasattr(conn, 'get_fsid'):
- fsid = conn.get_fsid()
+ # Librados's get_fsid is represented as binary
+ # in py3 instead of str as it is in py2.
+ # This is causing problems with ceph.
+ # Decode binary to str fixes these issues.
+ # Fix with encodeutils.safe_decode CAN BE REMOVED
+ # after librados's fix will be stable.
+ #
+ # More informations:
+ # https://bugs.launchpad.net/glance-store/+bug/1816721
+ # https://bugs.launchpad.net/cinder/+bug/1816468
+ # https://tracker.ceph.com/issues/38381
+ fsid = encodeutils.safe_decode(conn.get_fsid())
with conn.open_ioctx(self.pool) as ioctx:
order = int(math.log(self.WRITE_CHUNKSIZE, 2))
LOG.debug('creating image %s with order %d and size %d',