From 63740fa9ffe23b4985b706e15092af80780eaaaf Mon Sep 17 00:00:00 2001 From: Jose Castro Leon Date: Mon, 15 Jun 2020 15:46:55 +0200 Subject: [PATCH] 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 --- qa/tasks/cephfs/test_volume_client.py | 3 +++ src/pybind/ceph_volume_client.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/qa/tasks/cephfs/test_volume_client.py b/qa/tasks/cephfs/test_volume_client.py index 7f66218c593..2478955b931 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 8fcb0cf8fa3..b37d48ca260 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: -- 2.47.3