lvm: rework getLV for Stale or Unreadable LVs
aesteve-rh opened this issue · 0 comments
aesteve-rh commented
Problem
LVM.getLV successfully returns an LV even if it is Stale or Unreadable (so no namedtuple's attributes),
and then the code that invoked it may raise AttributeError
on access.
This will happen later and deep in unrelated code, and makes debugging harder.
Stale LV behaves similarly, but maybe even worse, you get AttributeError
without any context.
Proposal
See who calls LVM.getLV and how these potential errors are handled.
It is probably better to fail immediately if the LV is not readable or stale.
Explore this possibility and apply changes as needed.