From f25371e1aedc87510bd0e6305bd802c047775398 Mon Sep 17 00:00:00 2001 From: Ramana Raja Date: Mon, 30 Sep 2019 19:21:29 +0530 Subject: [PATCH] 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 (cherry picked from commit 8f24f42d46d6b32838e8f6ac5c92eb5a32a99824) --- src/pybind/mgr/volumes/fs/subvolspec.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/volumes/fs/subvolspec.py b/src/pybind/mgr/volumes/fs/subvolspec.py index 60fb6d06af009..56c5128a54cd5 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) -- 2.39.5