From: Loic Dachary Date: Thu, 3 Aug 2017 08:56:24 +0000 (+0200) Subject: ceph-disk: dmcrypt cluster must default to ceph X-Git-Tag: ses5-milestone10~3^2~9^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16776%2Fhead;p=ceph.git ceph-disk: dmcrypt cluster must default to ceph If ceph_fsid is not found, which is the case for legacy dmcrypted OSD, the cluster must default to ceph, as it was before support for non standard cluster names was introduced. Fixes: http://tracker.ceph.com/issues/20893 Signed-off-by: Loic Dachary --- diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py index a0cd91f54c4..8b0c5dbc389 100755 --- a/src/ceph-disk/ceph_disk/main.py +++ b/src/ceph-disk/ceph_disk/main.py @@ -1279,11 +1279,14 @@ def get_dmcrypt_key( osd_uuid = get_oneliner(path, 'osd-uuid') ceph_fsid = read_one_line(path, 'ceph_fsid') if ceph_fsid is None: - raise Error('No cluster uuid assigned.') - cluster = find_cluster_by_uuid(ceph_fsid) - if cluster is None: - raise Error('No cluster conf found in ' + SYSCONFDIR + - ' with fsid %s' % ceph_fsid) + LOG.warning("no `ceph_fsid` found falling back to 'ceph' " + "for cluster name") + cluster = 'ceph' + else: + cluster = find_cluster_by_uuid(ceph_fsid) + if cluster is None: + raise Error('No cluster conf found in ' + SYSCONFDIR + + ' with fsid %s' % ceph_fsid) if mode == KEY_MANAGEMENT_MODE_V1: key, stderr, ret = command(