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 <guillaume.giamarchi@gmail.com>
This commit is contained in:
Guillaume Giamarchi 2014-12-13 18:46:52 +01:00
parent 477fffb1ba
commit 6c5da2bc0e
1 changed files with 7 additions and 1 deletions

View File

@ -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)