Skip to content

Commit

Permalink
Remove error message when key path is not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
sasadangelo committed Oct 13, 2020
1 parent 768f25f commit 4fc8d47
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions client.go
Expand Up @@ -8,7 +8,6 @@ import (
"net"
"os"
"os/user"
"path"
"strconv"
"strings"
"syscall"
Expand Down Expand Up @@ -56,11 +55,8 @@ func genSSHConfig(node *Node) *defaultClient {
var authMethods []ssh.AuthMethod

var pemBytes []byte
if node.KeyPath == "" {
pemBytes, err = ioutil.ReadFile(path.Join(u.HomeDir, ".ssh/id_rsa"))
} else {
if node.KeyPath != "" {
pemBytes, err = ioutil.ReadFile(node.KeyPath)
}
if err != nil {
l.Error(err)
} else {
Expand All @@ -76,6 +72,7 @@ func genSSHConfig(node *Node) *defaultClient {
authMethods = append(authMethods, ssh.PublicKeys(signer))
}
}
}

password := node.password()

Expand Down

0 comments on commit 4fc8d47

Please sign in to comment.