Merge pull request #2443 from pecigonzalo/b-winrm-communicator
Fix bug on WinRM connector
This commit is contained in:
commit
449f035c4d
|
@ -53,6 +53,7 @@ func (s *StepConnect) Run(state multistep.StateBag) multistep.StepAction {
|
|||
Config: s.Config,
|
||||
Host: s.Host,
|
||||
WinRMConfig: s.WinRMConfig,
|
||||
WinRMPort: s.SSHPort,
|
||||
},
|
||||
}
|
||||
for k, v := range s.CustomConnect {
|
||||
|
|
|
@ -25,6 +25,7 @@ type StepConnectWinRM struct {
|
|||
Config *Config
|
||||
Host func(multistep.StateBag) (string, error)
|
||||
WinRMConfig func(multistep.StateBag) (*WinRMConfig, error)
|
||||
WinRMPort func(multistep.StateBag) (int, error)
|
||||
}
|
||||
|
||||
func (s *StepConnectWinRM) Run(state multistep.StateBag) multistep.StepAction {
|
||||
|
@ -96,6 +97,13 @@ func (s *StepConnectWinRM) waitForWinRM(state multistep.StateBag, cancel <-chan
|
|||
continue
|
||||
}
|
||||
port := s.Config.WinRMPort
|
||||
if s.WinRMPort != nil {
|
||||
port, err = s.WinRMPort(state)
|
||||
if err != nil {
|
||||
log.Printf("[DEBUG] Error getting WinRM port: %s", err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
user := s.Config.WinRMUser
|
||||
password := s.Config.WinRMPassword
|
||||
|
|
Loading…
Reference in New Issue