]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: fix a bug in get_all_devices_vgs()
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 2 Nov 2022 15:03:17 +0000 (16:03 +0100)
committerYuri Weinstein <yweinste@redhat.com>
Wed, 5 Apr 2023 22:33:02 +0000 (22:33 +0000)
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>
(cherry picked from commit 770cd09412f933eeb93426a8acfc4f4666c99024)
(cherry picked from commit bd9b1c8eb5d0f1708d7fae50e85d6bf0b52f38c7)

src/ceph-volume/ceph_volume/api/lvm.py

index 3b554c7a41defcc3c058c4bf1ac4f5425a4b2f6a..14d4baed28f05d7fd4ec3f64fb210e544cfc539d 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']]
 
 #################################
 #