Commit 04463f82 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

communicator/ssh: ConnectFunc times out after 15 sceonds

parent 9718a465
...@@ -3,6 +3,7 @@ package ssh ...@@ -3,6 +3,7 @@ package ssh
import ( import (
"log" "log"
"net" "net"
"time"
) )
// ConnectFunc is a convenience method for returning a function // ConnectFunc is a convenience method for returning a function
...@@ -11,6 +12,6 @@ import ( ...@@ -11,6 +12,6 @@ import (
func ConnectFunc(network, addr string) func() (net.Conn, error) { func ConnectFunc(network, addr string) func() (net.Conn, error) {
return func() (net.Conn, error) { return func() (net.Conn, error) {
log.Printf("Opening conn for SSH to %s %s", network, addr) log.Printf("Opening conn for SSH to %s %s", network, addr)
return net.Dial(network, addr) return net.DialTimeout(network, addr, 15 * time.Second)
} }
} }
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