fix tests

This commit is contained in:
Megan Marsh 2019-10-21 14:08:49 -07:00
parent fe5ea886a2
commit e439dd039b
2 changed files with 5 additions and 7 deletions

View File

@ -153,8 +153,8 @@ type CommonConfig struct {
func (c *CommonConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig) ([]error, []string) {
// Accumulate any errors and warns
errs := make([]error, 0)
warns := make([]string, 0)
var errs []error
var warns []string
if c.VMName == "" {
c.VMName = fmt.Sprintf("packer-%s", pc.PackerBuildName)
@ -178,12 +178,12 @@ func (c *CommonConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig
}
if len(c.AdditionalDiskSize) > 64 {
err := fmt.Errorf("VM's currently support a maximum of 64 additional SCSI attached disks.")
errs = append(errs, err)
errs = append(errs, fmt.Errorf("VM's currently support a maximum of 64 additional SCSI attached disks."))
}
// Errors
errs = c.FloppyConfig.Prepare(ctx)
floppyerrs := c.FloppyConfig.Prepare(ctx)
errs = append(errs, floppyerrs...)
if c.GuestAdditionsMode == "" {
if c.GuestAdditionsPath != "" {
c.GuestAdditionsMode = "attach"

View File

@ -53,7 +53,6 @@ type Config struct {
common.PackerConfig `mapstructure:",squash"`
common.HTTPConfig `mapstructure:",squash"`
common.ISOConfig `mapstructure:",squash"`
common.FloppyConfig `mapstructure:",squash"`
bootcommand.BootConfig `mapstructure:",squash"`
hypervcommon.OutputConfig `mapstructure:",squash"`
hypervcommon.SSHConfig `mapstructure:",squash"`
@ -108,7 +107,6 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
errs = packer.MultiErrorAppend(errs, isoErrs...)
errs = packer.MultiErrorAppend(errs, b.config.BootConfig.Prepare(&b.config.ctx)...)
errs = packer.MultiErrorAppend(errs, b.config.FloppyConfig.Prepare(&b.config.ctx)...)
errs = packer.MultiErrorAppend(errs, b.config.HTTPConfig.Prepare(&b.config.ctx)...)
errs = packer.MultiErrorAppend(errs, b.config.OutputConfig.Prepare(&b.config.ctx, &b.config.PackerConfig)...)
errs = packer.MultiErrorAppend(errs, b.config.SSHConfig.Prepare(&b.config.ctx)...)