From ee800cc7c2550c7dc962c2f3277d575805fb60ba Mon Sep 17 00:00:00 2001 From: Benjamin Schiborr Date: Mon, 6 Nov 2017 13:56:11 -0800 Subject: [PATCH] provisioners/salt: #8991: Break if success This commit ensures that we actually break when the download was successful. Before it tried to download again for every iteration of the loop. In addition the number of iterations have been increased. I've experienced timeouts on third retry. Increasing to 5. --- plugins/provisioners/salt/bootstrap-salt.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/provisioners/salt/bootstrap-salt.ps1 b/plugins/provisioners/salt/bootstrap-salt.ps1 index 1317da19d..829b8398d 100644 --- a/plugins/provisioners/salt/bootstrap-salt.ps1 +++ b/plugins/provisioners/salt/bootstrap-salt.ps1 @@ -60,8 +60,9 @@ Do { $retries++ $ErrorActionPreference='Stop' $webclient.DownloadFile($url, $file) + break } catch [Exception] { - if($retries -eq 3) { + if($retries -eq 5) { $_ $_.GetType() $_.Exception @@ -73,7 +74,7 @@ Do { Start-Sleep -s 2 } } -Until($retries -eq 3) +Until($retries -eq 5) # Install minion silently