From: Jan Fajerski Date: Mon, 27 Apr 2020 09:44:56 +0000 (+0200) Subject: ceph-volume: util.device - add vg_free_percent property X-Git-Tag: v16.1.0~950^2~27 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f48d225454e3ec347952d85262aa03b71bfb9111;p=ceph.git ceph-volume: util.device - add vg_free_percent property Signed-off-by: Jan Fajerski --- diff --git a/src/ceph-volume/ceph_volume/util/device.py b/src/ceph-volume/ceph_volume/util/device.py index 5ab2b2917733..572e2afaea4c 100644 --- a/src/ceph-volume/ceph_volume/util/device.py +++ b/src/ceph-volume/ceph_volume/util/device.py @@ -418,6 +418,12 @@ class Device(object): if lv.tags.get("ceph.type") in ["data", "block"]] return any(osd_ids) + @property + def vg_free_percent(self): + if self.vgs: + return [vg.vg_free_count / vg.vg_extent_count for vg in self.vgs] + else: + return [1] def _check_generic_reject_reasons(self): reasons = [