mirror of https://github.com/docker/docs.git
Bugfix on openstack `machine ssh`
Bypass argument management for sudo if there is not arguments Signed-off-by: Guillaume Giamarchi <guillaume.giamarchi@gmail.com>
This commit is contained in:
parent
9fc0e3d72b
commit
c304288a82
|
|
@ -380,7 +380,7 @@ func (d *Driver) GetSSHCommand(args ...string) (*exec.Cmd, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if d.SSHUser != "root" {
|
if len(args) != 0 && d.SSHUser != "root" {
|
||||||
cmd := strings.Replace(strings.Join(args, " "), "'", "\\'", -1)
|
cmd := strings.Replace(strings.Join(args, " "), "'", "\\'", -1)
|
||||||
args = []string{"sudo", "sh", "-c", fmt.Sprintf("'%s'", cmd)}
|
args = []string{"sudo", "sh", "-c", fmt.Sprintf("'%s'", cmd)}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue