builder/digitalocean: timeout TCP connections to SSH
This commit is contained in:
parent
b78fd17a0a
commit
867e9d1c8f
|
@ -61,7 +61,10 @@ func (s *stepConnectSSH) Run(state map[string]interface{}) multistep.StepAction
|
||||||
log.Printf(
|
log.Printf(
|
||||||
"Opening TCP conn for SSH to %s:%d (attempt %d)",
|
"Opening TCP conn for SSH to %s:%d (attempt %d)",
|
||||||
ipAddress, config.SSHPort, attempts)
|
ipAddress, config.SSHPort, attempts)
|
||||||
s.conn, err = net.Dial("tcp", fmt.Sprintf("%s:%d", ipAddress, config.SSHPort))
|
s.conn, err = net.DialTimeout(
|
||||||
|
"tcp",
|
||||||
|
fmt.Sprintf("%s:%d", ipAddress, config.SSHPort),
|
||||||
|
10*time.Second)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue