update connectErr err to panic for multiple hosts

This commit is contained in:
2023-01-02 12:28:33 -06:00
parent 42034a7c15
commit a5f4ba3c2a
3 changed files with 29 additions and 48 deletions

View File

@ -106,7 +106,7 @@ func (remoteConfig *Host) ConnectToSSHHost() (*ssh.Client, error) {
for _, host := range remoteConfig.HostName {
sshConnection, connectErr = ssh.Dial("tcp", host, sshConfig)
if connectErr != nil {
continue
panic(fmt.Errorf("error when connecting to host %s: %w", host, connectErr))
}
}
break