From: houlinfei Date: Thu, 2 Jun 2016 15:09:32 +0000 (-0400) Subject: ceph-disk: modify the disk partition sequence of ceph-disk list X-Git-Tag: v11.0.0~170^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b3ad73de74d85d45153f7839864bd87a13e697b3;p=ceph.git ceph-disk: modify the disk partition sequence of ceph-disk list 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 --- diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py index 777014f84448..9a3f9cc1e2cd 100755 --- a/src/ceph-disk/ceph_disk/main.py +++ b/src/ceph-disk/ceph_disk/main.py @@ -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: