changes in wording
This commit is contained in:
parent
0a1dbb61a1
commit
d701d26938
@ -59,12 +59,12 @@ func (command Command) runCmd() logging.Logging {
|
||||
remoteHost.Port = 22
|
||||
remoteHost.Host = command.RemoteHost.Host
|
||||
|
||||
sshc, err := remoteHost.ConnectToSSHHost()
|
||||
sshConnection, err := remoteHost.ConnectToSSHHost()
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("ssh dial: %w", err))
|
||||
}
|
||||
defer sshc.Close()
|
||||
s, err := sshc.NewSession()
|
||||
defer sshConnection.Close()
|
||||
s, err := sshConnection.NewSession()
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("new ssh session: %w", err))
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ func (config SshConfig) GetSSHConfig() (SshConfig, error) {
|
||||
|
||||
func (remoteConfig *Host) ConnectToSSHHost() (*ssh.Client, error) {
|
||||
|
||||
var sshc *ssh.Client
|
||||
var sshConnection *ssh.Client
|
||||
var connectErr error
|
||||
|
||||
f, _ := os.Open(filepath.Join(os.Getenv("HOME"), ".ssh", "config"))
|
||||
@ -104,14 +104,14 @@ func (remoteConfig *Host) ConnectToSSHHost() (*ssh.Client, error) {
|
||||
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
|
||||
}
|
||||
for _, host := range remoteConfig.HostName {
|
||||
sshc, connectErr = ssh.Dial("tcp", host, sshConfig)
|
||||
sshConnection, connectErr = ssh.Dial("tcp", host, sshConfig)
|
||||
if connectErr != nil {
|
||||
continue
|
||||
break
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
}
|
||||
return sshc, connectErr
|
||||
return sshConnection, connectErr
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user