Merge branch '21535-multi-wf-delete'
[arvados.git] / lib / dispatchcloud / sshexecutor / executor.go
index c37169921cf594ac035263ad4c53d4c176c13214..3761c699225079704c26889197913ae3cd3e8eca 100644 (file)
@@ -18,6 +18,8 @@ import (
        "golang.org/x/crypto/ssh"
 )
 
+var ErrNoAddress = errors.New("instance has no address")
+
 // New returns a new Executor, using the given target.
 func New(t cloud.ExecutorTarget) *Executor {
        return &Executor{target: t}
@@ -196,7 +198,7 @@ func (exr *Executor) TargetHostPort() (string, string) {
 func (exr *Executor) setupSSHClient() (*ssh.Client, error) {
        addr := net.JoinHostPort(exr.TargetHostPort())
        if addr == ":" {
-               return nil, errors.New("instance has no address")
+               return nil, ErrNoAddress
        }
        var receivedKey ssh.PublicKey
        client, err := ssh.Dial("tcp", addr, &ssh.ClientConfig{