with dmcrypt device, ceph-disk list will get Nonetype with the real device
i.e. /dev/sdb1 for /dev/dm-1, `ceph-disk --list /dev/sdb1` will get Nonetype
that because the holder we query is `dm-x`, the devices includ the path
is `sdX`, it cannot match.
if we list format plain and meet dmcrypt device, query again with the
holder (dm-x).
Also change the list_devices() parameter to let other function to use it
easily.
Signed-off-by: Vicente Cheng <freeze.bilsted@gmail.com>
desc = ['ceph data (dmcrypt %s)' % dmcrypt['type'], 'not currently mapped']
elif len(dmcrypt['holders']) == 1:
holder = '/dev/' + dmcrypt['holders'][0]
+ # re-list with the dm-x path
+ devices = list_devices([holder])
def lookup_dev(devices, path):
for device in devices:
if device['path'] == path:
return info
-def list_devices(args):
- partmap = list_all_partitions(args.path)
+def list_devices(path):
+ partmap = list_all_partitions(path)
uuid_map = {}
journal_map = {}
return devices
def main_list(args):
- devices = list_devices(args)
+ devices = list_devices(args.path)
if args.format == 'json':
print json.dumps(devices)
else: