]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/ceph-volume/ceph_volume/configuration.py
import ceph quincy 17.2.4
[ceph.git] / ceph / src / ceph-volume / ceph_volume / configuration.py
index 2fee47ffab910ad4c4310bbc6581c5c769a0bd9f..e0f7ef1f0c6551e89385643cf77ec51e3d1f02b2 100644 (file)
@@ -86,13 +86,14 @@ class Conf(conf_parentclass):
         s = '_'.join(s.split())
         return s
 
-    def get_safe(self, section, key, default=None):
+    def get_safe(self, section, key, default=None, check_valid=True):
         """
         Attempt to get a configuration value from a certain section
         in a ``cfg`` object but returning None if not found. Avoids the need
         to be doing try/except {ConfigParser Exceptions} every time.
         """
-        self.is_valid()
+        if check_valid:
+            self.is_valid()
         try:
             return self.get(section, key)
         except (configparser.NoSectionError, configparser.NoOptionError):