From: Jan Fajerski Date: Mon, 27 Apr 2020 09:21:37 +0000 (+0200) Subject: ceph-volume: api/lvm - add VolumeGroup.free_percent property X-Git-Tag: v16.1.0~950^2~26 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bad54e97817dfef0e7dfcb834753cbb728c3de46;p=ceph.git ceph-volume: api/lvm - add VolumeGroup.free_percent property Signed-off-by: Jan Fajerski --- diff --git a/src/ceph-volume/ceph_volume/api/lvm.py b/src/ceph-volume/ceph_volume/api/lvm.py index c862b3d80af9..461e010506c2 100644 --- a/src/ceph-volume/ceph_volume/api/lvm.py +++ b/src/ceph-volume/ceph_volume/api/lvm.py @@ -518,6 +518,13 @@ class VolumeGroup(object): """ return int(self.vg_extent_size) * int(self.vg_free_count) + @property + def free_percent(self): + """ + Return free space in VG in bytes + """ + return int(self.vg_free_count) / int(self.vg_extent_count) + @property def size(self): """