]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: fix lvm activate arguments 43116/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:19:44 +0000 (16:19 +0200)
commitb656b6be76b151f49e6158ac604a0db80c15353c
tree3a749a7c6a9bb3bec7639aa7eb5c99753b996983
parent2cfd600a846afa70e2bde3c05374b04a384a23d5
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