1 Star 0 Fork 0

litian/machine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
redhat_ssh_commander.go 772 Bytes
一键复制 编辑 原始数据 按行查看 历史
package provision
import (
"github.com/docker/machine/libmachine/drivers"
"github.com/docker/machine/libmachine/ssh"
)
type RedHatSSHCommander struct {
Driver drivers.Driver
}
func (sshCmder RedHatSSHCommander) SSHCommand(args string) (string, error) {
client, err := drivers.GetSSHClientFromDriver(sshCmder.Driver)
if err != nil {
return "", err
}
// redhat needs "-t" for tty allocation on ssh therefore we check for the
// external client and add as needed.
// Note: CentOS 7.0 needs multiple "-tt" to force tty allocation when ssh has
// no local tty.
switch c := client.(type) {
case *ssh.ExternalClient:
c.BaseArgs = append(c.BaseArgs, "-tt")
client = c
case *ssh.NativeClient:
return c.OutputWithPty(args)
}
return client.Output(args)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/litian33/machine.git
git@gitee.com:litian33/machine.git
litian33
machine
machine
v0.8.0-rc1

搜索帮助