Comment 1 for bug 1819382

Revision history for this message
David Ames (thedac) wrote :

TRIAGE:

In is_active_bluestore_device call to check the return value of list_logical_volumes before attempting to get the zeroth value from the list.

diff --git a/lib/ceph/utils.py b/lib/ceph/utils.py
index 35f351f..220039b 100644
--- a/lib/ceph/utils.py
+++ b/lib/ceph/utils.py
@@ -1692,7 +1692,11 @@ def is_active_bluestore_device(dev):
         return False

     vg_name = lvm.list_lvm_volume_group(dev)
- lv_name = lvm.list_logical_volumes('vg_name={}'.format(vg_name))[0]
+ logical_volumes = lvm.list_logical_volumes('vg_name={}'.format(vg_name))
+ if logical_volumes:
+ lv_name = logical_volumes[0]
+ else:
+ return False