]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-daemon: behave with no /etc/ceph/ceph.conf
authorSage Weil <sage@redhat.com>
Tue, 10 Dec 2019 16:20:52 +0000 (10:20 -0600)
committerSage Weil <sage@redhat.com>
Sat, 14 Dec 2019 15:22:12 +0000 (09:22 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/cephadm/cephadm

index 6c87501c9a0ab220d99173359b26f01c25a8989c..7c34d61f613a3b5df27fa05cfb5bc45f9c611a54 100755 (executable)
@@ -419,10 +419,10 @@ def get_legacy_config_fsid(cluster, legacy_dir=None):
     if legacy_dir is not None:
         config_file = os.path.abspath(legacy_dir + config_file)
 
-    config = read_config(config_file)
-
-    if config.has_section('global') and config.has_option('global', 'fsid'):
-        return config.get('global', 'fsid')
+    if os.path.exists(config_file):
+        config = read_config(config_file)
+        if config.has_section('global') and config.has_option('global', 'fsid'):
+            return config.get('global', 'fsid')
     return None
 
 def get_legacy_daemon_fsid(cluster, daemon_type, daemon_id, legacy_dir=None):