builder/virtualbox: fix interpolation weirdness

This commit is contained in:
Mitchell Hashimoto 2015-06-22 09:17:09 -07:00
parent 54e081d5af
commit d600456487
1 changed files with 5 additions and 5 deletions

View File

@ -57,8 +57,12 @@ type Config struct {
}
func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
// Set some defaults
b.config.VMName = fmt.Sprintf("packer-%s-{{timestamp}}", b.config.PackerBuildName)
err := config.Decode(&b.config, &config.DecodeOpts{
Interpolate: true,
Interpolate: true,
InterpolateContext: &b.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{
"boot_command",
@ -112,10 +116,6 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
b.config.ISOInterface = "ide"
}
if b.config.VMName == "" {
b.config.VMName = fmt.Sprintf("packer-%s-{{timestamp}}", b.config.PackerBuildName)
}
if b.config.HardDriveInterface != "ide" && b.config.HardDriveInterface != "sata" && b.config.HardDriveInterface != "scsi" {
errs = packer.MultiErrorAppend(
errs, errors.New("hard_drive_interface can only be ide, sata, or scsi"))