From: Tim Serong Date: Thu, 23 Apr 2020 07:00:16 +0000 (+1000) Subject: cephadm: minor osd_type cleanup in OSD adopt X-Git-Tag: v16.1.0~2420^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=df201823b5263502b727c5a056de006b796bc49a;p=ceph.git cephadm: minor osd_type cleanup in OSD adopt This addresses a couple of the comments in https://github.com/ceph/ceph/pull/34565 Signed-off-by: Tim Serong --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 33b05c584c15..41a19425a4ca 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -3127,13 +3127,13 @@ class AdoptOsd(object): with open(path, 'r') as f: osd_fsid = f.read().strip() logger.info("Found online OSD at %s" % path) - if os.path.exists(os.path.join(self.osd_data_dir, 'type')): - with open(os.path.join(self.osd_data_dir, 'type')) as f: - osd_type = f.read().strip() - else: - logger.info('"type" file missing for OSD data dir') except IOError: logger.info('Unable to read OSD fsid from %s' % path) + if os.path.exists(os.path.join(self.osd_data_dir, 'type')): + with open(os.path.join(self.osd_data_dir, 'type')) as f: + osd_type = f.read().strip() + else: + logger.info('"type" file missing for OSD data dir') return osd_fsid, osd_type @@ -3215,6 +3215,7 @@ def command_adopt_ceph(daemon_type, daemon_id, fsid): if not osd_fsid: raise Error('Unable to find OSD {}'.format(daemon_id)) logger.info('objectstore_type is %s' % osd_type) + assert osd_type if osd_type == 'filestore': raise Error('FileStore is not supported by cephadm')