From e222d7bce218b732025ce094ed2d1bb31af0d6f6 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Tue, 5 Jan 2016 14:25:51 +0100 Subject: [PATCH] ceph-disk: display OSD details when listing dmcrypt devices The details about a device that mapped via dmcrypt are directly available. Do not try to fetch them from the device entry describing the devicemapper entry. http://tracker.ceph.com/issues/14230 Fixes: #14230 Signed-off-by: Loic Dachary (cherry picked from commit 7aab4ed6f108ddc7bc90300f1999a38f30da3a57) Conflicts: src/ceph-disk: an incorrect attempt was made to fix the same problem. It was not backported and does not need to be. It is entirely contained in the code block removed and is the reason for the conflict. --- src/ceph-disk | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ceph-disk b/src/ceph-disk index 7b7bf9c233c..71531f22ac9 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -2744,13 +2744,8 @@ def list_format_dev_plain(dev, devices=[], prefix=''): if not dmcrypt['holders']: desc = ['ceph data (dmcrypt %s)' % dmcrypt['type'], 'not currently mapped'] elif len(dmcrypt['holders']) == 1: - holder = '/dev/' + dmcrypt['holders'][0] - def lookup_dev(devices, path): - for device in devices: - if device['path'] == path: - return device - holder_dev = lookup_dev(devices, holder) - desc = ['ceph data (dmcrypt %s %s)' % (dmcrypt['type'], holder)] + list_format_more_osd_info_plain(holder_dev) + holder = get_dev_path(dmcrypt['holders'][0]) + desc = ['ceph data (dmcrypt %s %s)' % (dmcrypt['type'], holder)] + list_format_more_osd_info_plain(dev) else: desc = ['ceph data (dmcrypt %s)' % dmcrypt['type'], 'holders: ' + ','.join(dmcrypt['holders'])] elif dev['ptype'] == JOURNAL_UUID: -- 2.47.3