labs: always init local variable

Local variable LINE was not initialized (but still used in a log call)
if disk_registered returned false. Fixed.

Change-Id: Icd679b2e50fd0d11fb5689d5806a016ac8043f7f
This commit is contained in:
Roger Luethi 2014-08-30 10:49:22 +02:00
parent 084ed77427
commit 5c5994b258

View File

@ -186,8 +186,9 @@ function create_vdi {
function get_next_child_uuid {
local DISK=$1
local CHILD_UUID=""
local LINE=""
if disk_registered "$DISK"; then
local LINE=$(WBATCH= $VBM showhdinfo "$DISK" | grep -e "^Child UUIDs:")
LINE=$(WBATCH= $VBM showhdinfo "$DISK" | grep -e "^Child UUIDs:")
CHILD_UUID=${LINE##Child UUIDs:* }
fi
echo -e "next_child_uuid $DISK:\n\t$LINE\n\t$CHILD_UUID" >> "$VBM_LOG"