From 858a2b166fea155455bc84043673e36693357355 Mon Sep 17 00:00:00 2001 From: Stephen Taylor Date: Wed, 15 Jul 2020 17:42:09 +0000 Subject: [PATCH] [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 --- ceph-osd/templates/bin/osd/ceph-volume/_common.sh.tpl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ceph-osd/templates/bin/osd/ceph-volume/_common.sh.tpl b/ceph-osd/templates/bin/osd/ceph-volume/_common.sh.tpl index cc8a51629..ae013d5aa 100644 --- a/ceph-osd/templates/bin/osd/ceph-volume/_common.sh.tpl +++ b/ceph-osd/templates/bin/osd/ceph-volume/_common.sh.tpl @@ -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}