]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: dmcrypt cluster must default to ceph 16776/head
authorLoic Dachary <ldachary@redhat.com>
Thu, 3 Aug 2017 08:56:24 +0000 (10:56 +0200)
committerLoic Dachary <ldachary@redhat.com>
Thu, 3 Aug 2017 19:40:43 +0000 (21:40 +0200)
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 <loic@dachary.org>
src/ceph-disk/ceph_disk/main.py

index a0cd91f54c495e3546de63ac80b6f8451164e828..8b0c5dbc38961cc94ac4304e43bc0f7f3a51271c 100755 (executable)
@@ -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(