[ceph-osd] Add get_lv_from_device helper function

There was already a call to a nonexistent get_lv_from_device helper
function in get_lv_size_from_device. The get_lv_from_device function has
been added and the line in get_lvm_tag_from_device that gets the logical
volume has been updated to use the new helper function.

Change-Id: Ib34d7b1385e039d8c7bf82dcdb756bce2cc12bd2
This commit is contained in:
Stephen Taylor 2020-07-15 17:42:09 +00:00
parent 6409bb6879
commit 858a2b166f

View File

@ -299,6 +299,13 @@ function udev_settle {
udevadm settle --timeout=600 udevadm settle --timeout=600
} }
# Helper function to get a logical volume from a physical volume
function get_lv_from_device {
device="$1"
locked pvdisplay -m ${device} | awk '/Logical volume/{print $3}'
}
# Helper function to get an lvm tag from a logical volume # Helper function to get an lvm tag from a logical volume
function get_lvm_tag_from_volume { function get_lvm_tag_from_volume {
logical_volume="$1" logical_volume="$1"
@ -318,7 +325,7 @@ function get_lvm_tag_from_device {
device="$1" device="$1"
tag="$2" tag="$2"
# Attempt to get a logical volume for the physical device # Attempt to get a logical volume for the physical device
logical_volume="$(locked pvdisplay -m ${device} | awk '/Logical volume/{print $3}')" logical_volume="$(get_lv_from_device ${device})"
# Use get_lvm_tag_from_volume to get the specified tag from the logical volume # Use get_lvm_tag_from_volume to get the specified tag from the logical volume
get_lvm_tag_from_volume ${logical_volume} ${tag} get_lvm_tag_from_volume ${logical_volume} ${tag}