Skip to content

Commit

Permalink
Merge pull request ceph#24977 from alfredodeza/wip-bz1644265
Browse files Browse the repository at this point in the history
ceph-volume util.encryption robust blkid+lsblk detection of lockbox

Reviewed-by: Andrew Schoen <[email protected]>
  • Loading branch information
andrewschoen authored Nov 7, 2018
2 parents 59db1dc + fc3e6ea commit bd35043
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ceph-volume/ceph_volume/util/encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
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

Expand Down Expand Up @@ -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

0 comments on commit bd35043

Please sign in to comment.