fix: change ControlPath to .vuls of SSH option (#618)

This commit is contained in:
Kota Kanbe
2018-03-14 16:39:17 +09:00
committed by GitHub
parent 9afbf1255f
commit 0c919da4b1
6 changed files with 55 additions and 2 deletions

View File

@@ -45,6 +45,7 @@ type ConfigtestCmd struct {
deep bool
debug bool
vvv bool
}
// Name return subcommand name
@@ -68,6 +69,7 @@ func (*ConfigtestCmd) Usage() string {
[-containers-only]
[-http-proxy=http://192.168.0.1:8080]
[-debug]
[-vvv]
[SERVER]...
`
@@ -125,6 +127,8 @@ func (p *ConfigtestCmd) SetFlags(f *flag.FlagSet) {
"containers-only",
false,
"Test containers only. Default: Test both of hosts and containers")
f.BoolVar(&p.vvv, "vvv", false, "ssh -vvv")
}
// Execute execute
@@ -134,6 +138,11 @@ func (p *ConfigtestCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interfa
c.Conf.LogDir = p.logDir
util.Log = util.NewCustomLogger(c.ServerInfo{})
if err := mkdirDotVuls(); err != nil {
util.Log.Errorf("Failed to create .vuls: %s", err)
return subcommands.ExitUsageError
}
var keyPass string
var err error
if p.askKeyPassword {
@@ -161,6 +170,7 @@ func (p *ConfigtestCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interfa
if !(c.Conf.Fast || c.Conf.Offline || c.Conf.Deep) {
c.Conf.Fast = true
}
c.Conf.Vvv = p.vvv
var servernames []string
if 0 < len(f.Args()) {