From 6c5da2bc0e1280d18f105b6dd766f0bae2ddfe3b Mon Sep 17 00:00:00 2001 From: Guillaume Giamarchi Date: Sat, 13 Dec 2014 18:46:52 +0100 Subject: [PATCH] Fix bug SSH interactive mode Commit b44db20 introduced a bug that broke the SSH interactive mode. If no command is provided, Driver.GetSSHCommand is called with an empty string instead of no parameter. Signed-off-by: Guillaume Giamarchi --- commands.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/commands.go b/commands.go index 6e079db9b4..9e90f06744 100644 --- a/commands.go +++ b/commands.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "os" + "os/exec" "strings" "sync" "text/tabwriter" @@ -373,7 +374,12 @@ var Commands = []cli.Command{ os.Exit(1) } - sshCmd, err := host.Driver.GetSSHCommand(c.String("command")) + var sshCmd *exec.Cmd + if c.String("command") == "" { + sshCmd, err = host.Driver.GetSSHCommand() + } else { + sshCmd, err = host.Driver.GetSSHCommand(c.String("command")) + } if err != nil { log.Errorf("%s", err) os.Exit(1)