Merge "[ceph-osd] Add get_lv_from_device helper function"

This commit is contained in:
Zuul 2020-07-17 10:03:10 +00:00 committed by Gerrit Code Review
commit a689846b10

View File

@ -299,6 +299,13 @@ function udev_settle {
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
function get_lvm_tag_from_volume {
logical_volume="$1"
@ -318,7 +325,7 @@ function get_lvm_tag_from_device {
device="$1"
tag="$2"
# 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
get_lvm_tag_from_volume ${logical_volume} ${tag}