From: Sage Weil Date: Tue, 10 Dec 2019 16:20:52 +0000 (-0600) Subject: ceph-daemon: behave with no /etc/ceph/ceph.conf X-Git-Tag: v15.1.0~498^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=bf0e51a5b7b7bff63e407d86f320eecf0aa95051;p=ceph.git ceph-daemon: behave with no /etc/ceph/ceph.conf Signed-off-by: Sage Weil --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 6c87501c9a0ab..7c34d61f613a3 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):