From: Loic Dachary Date: Tue, 5 Jan 2016 13:25:51 +0000 (+0100) Subject: ceph-disk: display OSD details when listing dmcrypt devices X-Git-Tag: v9.2.1~32^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e222d7bce218b732025ce094ed2d1bb31af0d6f6;p=ceph.git 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. --- 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: