From e01ef3d7f3566e5d1c5730d4634cf159d0febb02 Mon Sep 17 00:00:00 2001 From: James Kwon <96548424+hongil0316@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:24:43 -0400 Subject: [PATCH] fix: move the logging line --- modules/ssh/ssh.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ssh/ssh.go b/modules/ssh/ssh.go index 147363550..8776e341d 100644 --- a/modules/ssh/ssh.go +++ b/modules/ssh/ssh.go @@ -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 } @@ -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)