]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-volume util.encryption robust blkid+lsblk detection of lockbox
authorAlfredo Deza <adeza@redhat.com>
Fri, 2 Nov 2018 19:03:45 +0000 (15:03 -0400)
committerAlfredo Deza <alfredo@deza.pe>
Wed, 7 Nov 2018 16:47:10 +0000 (11:47 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/util/encryption.py

index 8bb7d47c4903fb83e9fcbd27522b648256d70e30..90a4d1dada4e75cbe2a0edf495723b7bf766dc1d 100644 (file)
@@ -3,6 +3,7 @@ import os
 import logging
 from ceph_volume import process, conf
 from ceph_volume.util import constants, system
+from ceph_volume.util.device import Device
 from .prepare import write_keyring
 from .disk import lsblk, device_family, get_part_entry_type
 
@@ -251,9 +252,9 @@ def legacy_encrypted(device):
         return metadata
     parent_device = disk_meta['PKNAME']
     # With the parent device set, we can now look for the lockbox listing associated devices
-    devices = device_family(parent_device)
-    for i in devices:
-        if 'lockbox' in i.get('PARTLABEL', ''):
-            metadata['lockbox'] = i['NAME']
+    devices = [Device(i['NAME']) for i in device_family(parent_device)]
+    for d in devices:
+        if d.ceph_disk.type == 'lockbox':
+            metadata['lockbox'] = d.abspath
             break
     return metadata