github.com/rothwerx/packer@v0.9.0/builder/parallels/common/run_config.go (about) 1 package common 2 3 import ( 4 "fmt" 5 "time" 6 7 "github.com/mitchellh/packer/template/interpolate" 8 ) 9 10 type RunConfig struct { 11 RawBootWait string `mapstructure:"boot_wait"` 12 13 BootWait time.Duration `` 14 } 15 16 func (c *RunConfig) Prepare(ctx *interpolate.Context) []error { 17 if c.RawBootWait == "" { 18 c.RawBootWait = "10s" 19 } 20 21 var err error 22 c.BootWait, err = time.ParseDuration(c.RawBootWait) 23 if err != nil { 24 return []error{fmt.Errorf("Failed parsing boot_wait: %s", err)} 25 } 26 27 return nil 28 }