ceph-daemon: behave with no /etc/ceph/ceph.conf

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2019-12-10 10:20:52 -06:00
parent 2d915c8d0e
commit bf0e51a5b7

View File

@ -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):