From: Alfredo Deza Date: Tue, 27 Mar 2018 11:51:03 +0000 (-0400) Subject: ceph-volume lvm.listing create a helper that lists osds X-Git-Tag: v13.1.0~336^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cee7612ce400ca4bc3e6e5dbcc1a158178edafe5;p=ceph.git ceph-volume lvm.listing create a helper that lists osds Signed-off-by: Alfredo Deza --- diff --git a/src/ceph-volume/ceph_volume/devices/lvm/listing.py b/src/ceph-volume/ceph_volume/devices/lvm/listing.py index 71407d7ea9a3..d1d96d7adb5a 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/listing.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/listing.py @@ -52,6 +52,21 @@ def pretty_report(report): print(''.join(output)) +def direct_report(): + """ + Other non-cli consumers of listing information will want to consume the + report without the need to parse arguments or other flags. This helper + bypasses the need to deal with the class interface which is meant for cli + handling. + """ + _list = List([]) + # this is crucial: make sure that all paths will reflect current + # information. In the case of a system that has migrated, the disks will + # have changed paths + _list.update() + return _list.full_report() + + class List(object): help = 'list logical volumes and devices associated with Ceph'