From 5c5994b258ccf8ee8b73b7422c8787fc1d8d8a40 Mon Sep 17 00:00:00 2001 From: Roger Luethi Date: Sat, 30 Aug 2014 10:49:22 +0200 Subject: [PATCH] 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 --- labs/lib/osbash/virtualbox.functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/labs/lib/osbash/virtualbox.functions b/labs/lib/osbash/virtualbox.functions index 3b2714be..051ec496 100644 --- a/labs/lib/osbash/virtualbox.functions +++ b/labs/lib/osbash/virtualbox.functions @@ -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"