From: Jose Castro Leon Date: Mon, 15 Jun 2020 13:46:55 +0000 (+0200) Subject: pybind/ceph_volume_client: Handles purge of unicode directory names in python2.7 X-Git-Tag: v14.2.22~40^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=63740fa9ffe23b4985b706e15092af80780eaaaf;p=ceph.git pybind/ceph_volume_client: Handles purge of unicode directory names in python2.7 This change is not cherry-picked from master, because master has dropped python2 support. And this change is to print the path of "unicode" type in python2. Fixes: https://tracker.ceph.com/issues/45997 Signed-off-by: Jose Castro Leon --- diff --git a/qa/tasks/cephfs/test_volume_client.py b/qa/tasks/cephfs/test_volume_client.py index 7f66218c5932..2478955b9319 100644 --- a/qa/tasks/cephfs/test_volume_client.py +++ b/qa/tasks/cephfs/test_volume_client.py @@ -562,6 +562,9 @@ vc.disconnect() self.mount_a.run_shell(["touch", os.path.join(mount_path, "noperms")]) self.mount_a.run_shell(["chmod", "0000", os.path.join(mount_path, "noperms")]) + # A folder with non-ascii characters + self.mount_a.run_shell(["mkdir", os.path.join(mount_path, u"f\u00F6n")]) + self._volume_client_python(self.mount_b, dedent(""" vp = VolumePath("{group_id}", u"{volume_id}") vc.delete_volume(vp) diff --git a/src/pybind/ceph_volume_client.py b/src/pybind/ceph_volume_client.py index 8fcb0cf8fa33..b37d48ca2608 100644 --- a/src/pybind/ceph_volume_client.py +++ b/src/pybind/ceph_volume_client.py @@ -770,7 +770,7 @@ class CephFSVolumeClient(object): return def rmtree(root_path): - log.debug("rmtree {0}".format(root_path)) + log.debug(u"rmtree {0}".format(root_path)) dir_handle = self.fs.opendir(root_path) d = self.fs.readdir(dir_handle) while d: