From: Ramana Raja Date: Mon, 30 Sep 2019 13:51:29 +0000 (+0530) Subject: mgr/volumes: fix incorrect snapshot path creation X-Git-Tag: v15.1.0~1342^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F30654%2Fhead;p=ceph.git mgr/volumes: fix incorrect snapshot path creation 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 --- diff --git a/src/pybind/mgr/volumes/fs/subvolspec.py b/src/pybind/mgr/volumes/fs/subvolspec.py index 60fb6d06af0..56c5128a54c 100644 --- a/src/pybind/mgr/volumes/fs/subvolspec.py +++ b/src/pybind/mgr/volumes/fs/subvolspec.py @@ -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)