From 39dbeb43c65009c478aaf5726d0d554269228d74 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Mon, 21 May 2018 13:35:57 -0400 Subject: [PATCH] ceph-volume api.lvm force vgs to display units in 'g' Signed-off-by: Alfredo Deza (cherry picked from commit da9f90fcb40e1e82c322f6020253b63da69238da) --- src/ceph-volume/ceph_volume/api/lvm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ceph-volume/ceph_volume/api/lvm.py b/src/ceph-volume/ceph_volume/api/lvm.py index 2f2bd17388f65..6a69f257d3b93 100644 --- a/src/ceph-volume/ceph_volume/api/lvm.py +++ b/src/ceph-volume/ceph_volume/api/lvm.py @@ -174,15 +174,17 @@ def get_api_vgs(): Command and sample delimited output should look like:: - $ vgs --noheadings --readonly --separator=';' \ + $ vgs --noheadings --units=g --readonly --separator=';' \ -o vg_name,pv_count,lv_count,snap_count,vg_attr,vg_size,vg_free ubuntubox-vg;1;2;0;wz--n-;299.52g;12.00m osd_vg;3;1;0;wz--n-;29.21g;9.21g + To normalize sizing, the units are forced in 'g' which is equivalent to + gigabytes, which uses multiples of 1024 (as opposed to 1000) """ fields = 'vg_name,pv_count,lv_count,snap_count,vg_attr,vg_size,vg_free' stdout, stderr, returncode = process.call( - ['vgs', '--noheadings', '--readonly', '--separator=";"', '-o', fields] + ['vgs', '--noheadings', '--readonly', '--units=g', '--separator=";"', '-o', fields] ) return _output_parser(stdout, fields) -- 2.39.5