mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-08 14:21:14 +00:00
move agent socket dial to client connection creation
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package ssh
|
||||
|
||||
import (
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@@ -23,7 +24,12 @@ func Exec(cfg *ssh.ClientConfig, addr, cmd string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewClientConfig(ac agent.ExtendedAgent) (*ssh.ClientConfig, error) {
|
||||
func NewClientConfig() (*ssh.ClientConfig, error) {
|
||||
c, err := net.Dial("unix", os.Getenv("SSH_AUTH_SOCK"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ac := agent.NewClient(c)
|
||||
hkc, err := knownhosts.New(filepath.Join(os.Getenv("HOME"), ".ssh", "known_hosts"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -5,12 +5,10 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/crypto/ssh/agent"
|
||||
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
e2e "github.com/tendermint/tendermint/test/e2e/pkg"
|
||||
@@ -95,12 +93,7 @@ func NewCLI() *CLI {
|
||||
case "docker":
|
||||
cli.infp = &docker.Provider{Testnet: testnet}
|
||||
case "digital-ocean":
|
||||
c, err := net.Dial("unix", os.Getenv("SSH_AUTH_SOCK")) // TODO(williambanfield): Ensure this is a consistent location for the authentication socket of the agent.
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ac := agent.NewClient(c)
|
||||
cfg, err := e2essh.NewClientConfig(ac)
|
||||
cfg, err := e2essh.NewClientConfig()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user