]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes: fix incorrect snapshot path creation 31076/head
authorRamana Raja <rraja@redhat.com>
Mon, 30 Sep 2019 13:51:29 +0000 (19:21 +0530)
committerJos Collin <jcollin@redhat.com>
Wed, 23 Oct 2019 11:48:39 +0000 (17:18 +0530)
When constructing the snapshot path, the components are a mix of
byte and string type objects. The 'os.path.join()' method needs
the components to be of the same type. Hence convert all components
to byte type objects.

Introduced-by: 3d63cd947f55a8508f972ee249ea6a04836429ae
Fixes: https://tracker.ceph.com/issues/42096
Signed-off-by: Ramana Raja <rraja@redhat.com>
(cherry picked from commit 8f24f42d46d6b32838e8f6ac5c92eb5a32a99824)

src/pybind/mgr/volumes/fs/subvolspec.py

index 60fb6d06af00921861ec3dbe425c6fb3052c685e..56c5128a54cd503007ceee203994cc9e49202e4a 100644 (file)
@@ -90,13 +90,13 @@ class SubvolumeSpec(object):
         """
         return the subvolume snapshot path for a given snapshot name
         """
-        return os.path.join(self.subvolume_path, snapdir, snapname)
+        return os.path.join(self.subvolume_path, snapdir.encode('utf-8'), snapname.encode('utf-8'))
 
     def make_group_snap_path(self, snapdir, snapname):
         """
         return the group snapshot path for a given snapshot name
         """
-        return os.path.join(self.group_path, snapdir, snapname)
+        return os.path.join(self.group_path, snapdir.encode('utf-8'), snapname.encode('utf-8'))
 
     def __str__(self):
         return "{0}/{1}".format(self.groupid, self.subvolumeid)