From 8bb7d8dc169e120c286794484105376879d06df9 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Wed, 9 Oct 2019 17:55:16 -0700 Subject: [PATCH] Prevent busy loop while waiting for WinRM connection Set first run variable outside conditional so it will properly be updated during the first run and pause on subsequent runs. --- helper/communicator/step_connect_winrm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper/communicator/step_connect_winrm.go b/helper/communicator/step_connect_winrm.go index f1e30820a..275468bc1 100644 --- a/helper/communicator/step_connect_winrm.go +++ b/helper/communicator/step_connect_winrm.go @@ -95,8 +95,8 @@ func (s *StepConnectWinRM) waitForWinRM(state multistep.StateBag, ctx context.Co return nil, errors.New("WinRM wait cancelled") case <-time.After(5 * time.Second): } - first = false } + first = false host, err := s.Host(state) if err != nil {