From bad54e97817dfef0e7dfcb834753cbb728c3de46 Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Mon, 27 Apr 2020 11:21:37 +0200 Subject: [PATCH] ceph-volume: api/lvm - add VolumeGroup.free_percent property Signed-off-by: Jan Fajerski --- src/ceph-volume/ceph_volume/api/lvm.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ceph-volume/ceph_volume/api/lvm.py b/src/ceph-volume/ceph_volume/api/lvm.py index c862b3d80af9b..461e010506c2f 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): """ -- 2.39.5