]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: modify the disk partition sequence of ceph-disk list 9442/head
authorhoulinfei <hou.linfei@h3c.com>
Thu, 2 Jun 2016 15:09:32 +0000 (11:09 -0400)
committerhoulinfei <hou.linfei@h3c.com>
Thu, 2 Jun 2016 15:09:32 +0000 (11:09 -0400)
    before the change, when you execute ceph-disk list, it will show in this order:
    /dev/sda :
     /dev/sda2 ceph journal, for /dev/sda1
     /dev/sda1 ceph data, active, cluster ceph, osd.0, journal /dev/sda2

    after the change, it will show in this order:
    /dev/sda :
     /dev/sda1 ceph data, active, cluster ceph, osd.0, journal /dev/sda2
     /dev/sda2 ceph journal, for /dev/sda1

Signed-off-by: houlinfei <hou.linfei@h3c.com>
src/ceph-disk/ceph_disk/main.py

index 777014f844482989d96ebc56916ddcdd7a683486..9a3f9cc1e2cdb919ac80c1cb9918ced22a183986 100755 (executable)
@@ -3974,7 +3974,7 @@ def list_format_plain(devices):
     for device in devices:
         if device.get('partitions'):
             lines.append('%s :' % device['path'])
-            for p in sorted(device['partitions']):
+            for p in sorted(device['partitions'], key=lambda x: x['path']):
                 lines.append(list_format_dev_plain(dev=p,
                                                    prefix=' '))
         else: