]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: fix lvm activate arguments 43117/head
authorDimitri Savineau <dsavinea@redhat.com>
Thu, 26 Aug 2021 21:11:12 +0000 (17:11 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 9 Sep 2021 14:20:37 +0000 (16:20 +0200)
commit6cf7c91a3ec3e8af1ed9423a415eef1ebce8dd78
tree91c2618ae9c66741fcf817e811e03da15e929a75
parentc517d9b9833f9d42627132d8e32f9fc7908f5ec5
ceph-volume: fix lvm activate arguments

When using the `lvm activate` subcommand without any osd ID or osd FSID
then ceph-volume fails.

Currently we can either activate with:
 - both osd ID and osd FSID
 - only the osd FSID (because it's unique)

The remaining scenarios aren't covered and generate a stack trace:
 - only the osd ID
 - no osd ID nor osd FSID

This ends up with an error like:

-->  UnboundLocalError: local variable 'tags' referenced before assignment

Fixes: https://tracker.ceph.com/issues/50665
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit b77ed5f99d3cb14a46bb36bb74e4136c22edf48a)
src/ceph-volume/ceph_volume/devices/lvm/activate.py
src/ceph-volume/ceph_volume/tests/devices/lvm/test_activate.py