From 4307ead229533fc0dd9f076dcdd5e5fa299313b0 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 27 Feb 2018 16:13:04 +0000 Subject: xci: script: start-new-vm: Switch to using 'curl' instead of 'wget' curl supports the 'retry' argument to handle all sorts of connection problems so we can use it to retry if we encounter a broken connection. Change-Id: I3c8afd2be36ee36c5477f05495704bbbee5b9757 Signed-off-by: Markos Chandras --- xci/scripts/vm/start-new-vm.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xci/scripts/vm/start-new-vm.sh b/xci/scripts/vm/start-new-vm.sh index f53ec5ef..4f15f917 100755 --- a/xci/scripts/vm/start-new-vm.sh +++ b/xci/scripts/vm/start-new-vm.sh @@ -53,9 +53,10 @@ update_clean_vm_files() { local image_remote="${opnfv_url}/${OS}.qcow2" get_new_vm_files() { + echo "Downloading new ${OS} images from ${opnfv_url}" rm -rf ${vm_cache}/${OS}* - wget --quiet ${image_remote} - wget --quiet ${sha_remote} + curl -O -s --retry 10 ${image_remote} + curl -O -s --retry 10 ${sha_remote} } # There are 3 reasons why we want to fetch files from the GS storage @@ -68,7 +69,7 @@ update_clean_vm_files() { sha_local=$(awk '{print $1}' $shafile) if $XCI_UPDATE_CLEAN_VM_OS; then echo "Updating local copies of ${OS}..." - ! curl -s ${sha_remote} | grep -q ${sha_local} && \ + ! curl --retry 10 -s ${sha_remote} | grep -q ${sha_local} && \ get_new_vm_files fi echo "Verifying integrity of ${OS} files..." -- cgit