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: v15.2.9~122^2~28^2~32 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5ecbf74b72c29c8e26bb38707fa52d47118341e4;p=ceph.git ceph-volume: api/lvm - add VolumeGroup.free_percent property Signed-off-by: Jan Fajerski (cherry picked from commit bad54e97817dfef0e7dfcb834753cbb728c3de46) --- diff --git a/src/ceph-volume/ceph_volume/api/lvm.py b/src/ceph-volume/ceph_volume/api/lvm.py index 99524f35cd0..85bdeb62236 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): """