Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
ssh: log error message message to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
darkowlzz committed Apr 20, 2020
1 parent 8e4053b commit 3da3447
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/ignite/run/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

"github.com/alessio/shellescape"
log "github.com/sirupsen/logrus"
"golang.org/x/crypto/ssh"
"golang.org/x/crypto/ssh/terminal"

Expand Down Expand Up @@ -92,7 +93,7 @@ func runSSH(vm *api.VM, privKeyFile string, command []string, tty bool, timeout
// of returning an error, the runSSH function defers os.Exit with the ssh
// exit code. For showing any error to the user, it needs to be printed.
printErrAndSetExitCode := func(errMsg error, exitCode *int, code int) error {
fmt.Printf("%v\n", errMsg)
log.Errorf("%v\n", errMsg)
*exitCode = code
return nil
}
Expand Down

0 comments on commit 3da3447

Please sign in to comment.