]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/ceph_volume_client.py
import ceph 14.2.5
[ceph.git] / ceph / src / pybind / ceph_volume_client.py
index 754ad61f2f67fb2a5ed738dbba2cee75e0265aaa..7d7e5b49e40c9698f27e073ab5e4c06339e56168 100644 (file)
@@ -27,9 +27,11 @@ def to_bytes(param):
     Helper method that returns byte representation of the given parameter.
     '''
     if isinstance(param, str):
-        return param.encode()
+        return param.encode('utf-8')
+    elif param is None:
+        return param
     else:
-        return str(param).encode()
+        return str(param).encode('utf-8')
 
 class RadosError(Exception):
     """
@@ -476,7 +478,7 @@ class CephFSVolumeClient(object):
             self.evict(premount_evict)
             log.debug("Premount eviction of {0} completes".format(premount_evict))
         log.debug("CephFS mounting...")
-        self.fs.mount(filesystem_name=self.fs_name)
+        self.fs.mount(filesystem_name=to_bytes(self.fs_name))
         log.debug("Connection to cephfs complete")
 
         # Recover from partial auth updates due to a previous