]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes: use `SafeConfigParser` with py2
authorMichael Fritch <mfritch@suse.com>
Tue, 3 Mar 2020 15:15:57 +0000 (08:15 -0700)
committerRamana Raja <rraja@redhat.com>
Thu, 19 Mar 2020 12:57:32 +0000 (18:27 +0530)
Python3.2 renamed `SafeConfigParser` -> `ConfigParser`

Fixes: https://tracker.ceph.com/issues/44393
Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit 23efb9240ea6187386677e262dab7f87e1dbac42)

src/pybind/mgr/volumes/fs/operations/versions/metadata_manager.py

index ef2d23e2dbad012d24058dcae93877eadb0a82fd..1b6c432783783f9b378a1b9409c51551880ec60c 100644 (file)
@@ -32,7 +32,10 @@ class MetadataManager(object):
         self.fs = fs
         self.mode = mode
         self.config_path = config_path
-        self.config = configparser.ConfigParser()
+        if sys.version_info >= (3, 2):
+            self.config = configparser.ConfigParser()
+        else:
+            self.config = configparser.SafeConfigParser()
 
     def refresh(self):
         fd = None