Files
Packer-Cn/builder/parallels/common/ssh_config.go
T

28 lines
719 B
Go
Raw Normal View History

package common
import (
"time"
2014-09-03 20:23:39 -07:00
2017-04-04 13:39:01 -07:00
"github.com/hashicorp/packer/helper/communicator"
"github.com/hashicorp/packer/template/interpolate"
)
2016-12-16 21:51:55 +02:00
// SSHConfig contains the configuration for SSH communicator.
type SSHConfig struct {
2015-06-13 18:43:27 -04:00
Comm communicator.Config `mapstructure:",squash"`
2015-06-13 18:43:27 -04:00
// These are deprecated, but we keep them around for BC
// TODO(@mitchellh): remove
SSHWaitTimeout time.Duration `mapstructure:"ssh_wait_timeout"`
}
2016-12-16 21:51:55 +02:00
// Prepare sets the default values for SSH communicator properties.
2015-05-27 13:49:31 -07:00
func (c *SSHConfig) Prepare(ctx *interpolate.Context) []error {
2015-06-13 18:43:27 -04:00
// TODO: backwards compatibility, write fixer instead
if c.SSHWaitTimeout != 0 {
c.Comm.SSHTimeout = c.SSHWaitTimeout
}
2015-06-13 18:43:27 -04:00
return c.Comm.Prepare(ctx)
}