1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +03:00

M #: Fix minor bug on LVM delete operation (#1584)

If ZERO_LVM_ON_DELETE is not set the lock name will be undefined
when trying to remove the device.
This commit is contained in:
Christian González 2021-11-18 12:38:14 +01:00 committed by GitHub
parent 5bdbd0795e
commit 00a61d74a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,6 +68,8 @@ DEV=$($SSH "$DST_HOST" "readlink $DST_PATH 2> /dev/null | grep \"^/dev/\"")
if [ -n "$DEV" ]; then
LOCK="tm-fs_lvm-${DS_SYS_ID}.lock"
if [ "${ZERO_LVM_ON_DELETE}" = "yes" ]; then
# Activate device
ACTIVATE_CMD=$(cat <<EOF
@ -77,7 +79,7 @@ if [ -n "$DEV" ]; then
${SUDO} ${LVCHANGE} -ay "${DEV}"
EOF
)
LOCK="tm-fs_lvm-${DS_SYS_ID}.lock"
exclusive "${LOCK}" 120 ssh_exec_and_log "$DST_HOST_LVM" "$ACTIVATE_CMD" \
"Error activating disk $SRC_PATH"