]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/ceph_volume_client: Handles purge of unicode directory names in python2.7 36679/head
authorJose Castro Leon <jose.castro.leon@cern.ch>
Mon, 15 Jun 2020 13:46:55 +0000 (15:46 +0200)
committerRamana Raja <rraja@redhat.com>
Wed, 28 Apr 2021 18:59:35 +0000 (14:59 -0400)
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 <jose.castro.leon@cern.ch>
qa/tasks/cephfs/test_volume_client.py
src/pybind/ceph_volume_client.py

index 7f66218c5932e1f89c2cced473074f0826b86539..2478955b9319733bd54f14c30e2d82885c4f2418 100644 (file)
@@ -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)
index 8fcb0cf8fa33a45e476bfc47f2db4864ed44a609..b37d48ca26081202b931a88748c72be1e4294d8b 100644 (file)
@@ -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: