From bf0e51a5b7b7bff63e407d86f320eecf0aa95051 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 10 Dec 2019 10:20:52 -0600 Subject: [PATCH] ceph-daemon: behave with no /etc/ceph/ceph.conf Signed-off-by: Sage Weil --- src/cephadm/cephadm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 6c87501c9a0..7c34d61f613 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -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):