Skip to content

Commit

Permalink
ceph-volume: fix lvm list
Browse files Browse the repository at this point in the history
17957d9 introduced a regression in `lvm
list`.

When passing a vg/lv path for generating a single report, it fails
because the filter used in the `lvs` command isn't right. It uses the lv
name instead of the vg name because `os.path.basename(device)` is used
while it should be `os.path.dirname(device)`

Fixes: https://tracker.ceph.com/issues/43969

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 0179fed)
  • Loading branch information
guits authored and Jan Fajerski committed Feb 12, 2020
1 parent 6cb2aad commit 30dc935
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ceph-volume/ceph_volume/devices/lvm/listing.py
Expand Up @@ -169,7 +169,7 @@ def single_report(self, device):
lv = api.get_first_lv(filters={'vg_name': pv.vg_name})
# or VG.
else:
vg_name = os.path.basename(device)
vg_name = os.path.dirname(device)
lv = api.get_first_lv(filters={'vg_name': vg_name})
arg_is_vg = True

Expand Down

0 comments on commit 30dc935

Please sign in to comment.