]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: fix a bug in get_all_devices_vgs() 48707/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 2 Nov 2022 15:03:17 +0000 (16:03 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 14 Dec 2022 16:59:19 +0000 (17:59 +0100)
When a physical volume isn't a member of any volume group,
the function `get_all_devices_vgs()` in `ceph_volume.api.lvm`
shouldn't try to return an `VolumeGroup()` object against this
device.

Fixes: https://tracker.ceph.com/issues/57918
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
src/ceph-volume/ceph_volume/api/lvm.py

index b23466b7aa3cc53f315685e2059295cdad73ec65..5277102da9b26c4b73d654756890e2cb30787ac8 100644 (file)
@@ -794,7 +794,7 @@ def get_all_devices_vgs(name_prefix=''):
         verbose_on_failure=False
     )
     vgs = _output_parser(stdout, vg_fields)
-    return [VolumeGroup(**vg) for vg in vgs]
+    return [VolumeGroup(**vg) for vg in vgs if vg['vg_name']]
 
 #################################
 #