Possible fix for issue #1534

This commit is contained in:
Kenneth Skovhede
2016-02-11 14:54:30 +01:00
parent 65b45a3e17
commit 444922d1df
@@ -82,8 +82,17 @@ then
exit $EXIT_CODE
fi
LV_SNAPSHOT=`lvdisplay "$LV_GROUP/$NAME" | grep "LV (Name|Path)" | awk '{ print $NF}'`
if [ "$?" -ne 0 ]
#
# Get the path to the volume snapshot
# The cases are here to support various versions of lvdisplay
#
LV_SNAPSHOT=`lvdisplay "$LV_GROUP/$NAME" | grep "LV Path" | awk '{ print $NF}'`
if [ "$?" -ne 0 ] || [ -z "$LV_SNAPSHOT" ] || [ ! -e "$LV_SNAPSHOT" ]
then
LV_SNAPSHOT=`lvdisplay "$LV_GROUP/$NAME" | grep "LV Name" | awk '{ print $NF}'`
fi
if [ "$?" -ne 0 ] || [ -z "$LV_SNAPSHOT" ] || [ ! -e "$LV_SNAPSHOT" ]
then
EXIT_CODE=$?
echo "Error: Unable to determine LV path for volume $LV_GROUP/$NAME"