Skip to content

Commit

Permalink
Merge pull request #1440 from gruntwork-io/fix/ssh-logs
Browse files Browse the repository at this point in the history
fix: move the logging line
  • Loading branch information
james03160927 authored Aug 30, 2024
2 parents 1a1a8c1 + e01ef3d commit 5069b5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/ssh/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ func listFileInRemoteDir(t testing.TestingT, sshSession *SshSession, options Scp

// Added based on code: https://github.com/bramvdbogaerde/go-scp/pull/6/files
func copyFileFromRemote(t testing.TestingT, sshSession *SshSession, file *os.File, remotePath string, useSudo bool) error {
logger.Logf(t, "Running command %s on %s@%s", sshSession.Options.Command, sshSession.Options.Username, sshSession.Options.Address)
if err := setUpSSHClient(sshSession); err != nil {
return err
}
Expand All @@ -455,6 +454,8 @@ func copyFileFromRemote(t testing.TestingT, sshSession *SshSession, file *os.Fil
command = fmt.Sprintf("sudo %s", command)
}

logger.Logf(t, "Running command %s on %s@%s", command, sshSession.Options.Username, sshSession.Options.Address)

r, err := sshSession.Session.Output(command)
if err != nil {
fmt.Printf("error reading from remote stdout: %s", err)
Expand Down

0 comments on commit 5069b5e

Please sign in to comment.