From 3b514df2cf23a4a3187687036d8badcdccaa73b2 Mon Sep 17 00:00:00 2001 From: Ramana Raja Date: Tue, 11 Feb 2020 05:49:09 -0500 Subject: [PATCH] mgr/volumes: fix py2 compat issue Fix the following issue seen while upstream teuthology testing, File "/usr/share/ceph/mgr/volumes/fs/operations/versions/subvolume_base.py", line 98, in load_config self.metadata_mgr = MetadataManager(self.fs, self.legacy_config_path, 0o640) File "/usr/share/ceph/mgr/volumes/fs/operations/versions/subvolume_base.py", line 73, in legacy_config_path meta_config = "{0}.meta".format(m.digest().hex()) AttributeError: 'str' object has no attribute 'hex' This issue is not observed in master/octopus, as it only supports py3. Signed-off-by: Ramana Raja --- src/pybind/mgr/volumes/fs/operations/versions/subvolume_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_base.py b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_base.py index 466db0f6eb9a..7a3c9ee36030 100644 --- a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_base.py +++ b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_base.py @@ -70,7 +70,7 @@ class SubvolumeBase(object): def legacy_config_path(self): m = md5() m.update(self.base_path) - meta_config = "{0}.meta".format(m.digest().hex()) + meta_config = "{0}.meta".format(m.hexdigest()) return os.path.join(self.legacy_dir, meta_config.encode('utf-8')) @property -- 2.47.3