]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: dmcrypt cluster must default to ceph 16870/head
authorLoic Dachary <ldachary@redhat.com>
Thu, 3 Aug 2017 08:56:24 +0000 (10:56 +0200)
committerSage Weil <sage@redhat.com>
Mon, 7 Aug 2017 14:04:21 +0000 (10:04 -0400)
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>
(cherry picked from commit ed22159fdd7071a110e81cd7b63d7e0f2296761b)

src/ceph-disk/ceph_disk/main.py

index cabd7fff989504a0422de878d66ad731629a6875..86146399631f46e5cbd98ffeafb353b153940068 100755 (executable)
@@ -1152,11 +1152,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(