]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind: fix unicode handling in CephFSVolumeClient::purge 8452/head
authorJohn Spray <john.spray@redhat.com>
Fri, 1 Apr 2016 13:27:31 +0000 (14:27 +0100)
committerJohn Spray <john.spray@redhat.com>
Wed, 11 May 2016 15:53:16 +0000 (16:53 +0100)
os.path.join is sensitive to string encoding, but
just doing a straight substitution should not be.

Signed-off-by: John Spray <john.spray@redhat.com>
src/pybind/ceph_volume_client.py

index 656dce5d3d4b9d956442a13a9f2669311bd12982..e37c904f9dfb611f4904b95edec464db688948c3 100644 (file)
@@ -526,7 +526,10 @@ class CephFSVolumeClient(object):
             d = self.fs.readdir(dir_handle)
             while d:
                 if d.d_name not in [".", ".."]:
-                    d_full = os.path.join(root_path, d.d_name)
+                    # Do not use os.path.join because it is sensitive
+                    # to string encoding, we just pass through dnames
+                    # as byte arrays
+                    d_full = "{0}/{1}".format(root_path, d.d_name)
                     if d.is_dir():
                         rmtree(d_full)
                     else: