]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: display OSD details when listing dmcrypt devices
authorLoic Dachary <ldachary@redhat.com>
Tue, 5 Jan 2016 13:25:51 +0000 (14:25 +0100)
committerLoic Dachary <ldachary@redhat.com>
Thu, 7 Jan 2016 14:28:57 +0000 (15:28 +0100)
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 <loic@dachary.org>
(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

index 7b7bf9c233c9d6fdd10ebb0c8f4a3f3503cc4f8e..71531f22ac98a0d530b8cf418a852d00e5c65337 100755 (executable)
@@ -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: