github.phpd.cn/hashicorp/packer@v1.3.2/builder/vmware/common/ssh_config.go (about) 1 package common 2 3 import ( 4 "time" 5 6 "github.com/hashicorp/packer/helper/communicator" 7 "github.com/hashicorp/packer/template/interpolate" 8 ) 9 10 type SSHConfig struct { 11 Comm communicator.Config `mapstructure:",squash"` 12 13 // These are deprecated, but we keep them around for BC 14 // TODO(@mitchellh): remove 15 SSHSkipRequestPty bool `mapstructure:"ssh_skip_request_pty"` 16 SSHWaitTimeout time.Duration `mapstructure:"ssh_wait_timeout"` 17 } 18 19 func (c *SSHConfig) Prepare(ctx *interpolate.Context) []error { 20 // TODO: backwards compatibility, write fixer instead 21 if c.SSHWaitTimeout != 0 { 22 c.Comm.SSHTimeout = c.SSHWaitTimeout 23 } 24 if c.SSHSkipRequestPty { 25 c.Comm.SSHPty = false 26 } 27 28 return c.Comm.Prepare(ctx) 29 }