Commit 867e9d1c authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/digitalocean: timeout TCP connections to SSH

parent b78fd17a
......@@ -61,7 +61,10 @@ func (s *stepConnectSSH) Run(state map[string]interface{}) multistep.StepAction
log.Printf(
"Opening TCP conn for SSH to %s:%d (attempt %d)",
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 {
break
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment