Renamed both `cpu_count` and `memory_size` to `cpus` and `memory` (respective).

This commit is contained in:
Ali Rizvi-Santiago 2018-11-17 06:34:22 -06:00
parent 2249d829b8
commit eca26f43f2
2 changed files with 6 additions and 6 deletions

View File

@ -9,8 +9,8 @@ import (
type HWConfig struct { type HWConfig struct {
// cpu information // cpu information
CpuCount int `mapstructure:"cpu_count"` CpuCount int `mapstructure:"cpus"`
MemorySize int `mapstructure:"memory_size"` MemorySize int `mapstructure:"memory"`
// device presence // device presence
Sound string `mapstructure:"sound"` Sound string `mapstructure:"sound"`
@ -22,7 +22,7 @@ func (c *HWConfig) Prepare(ctx *interpolate.Context) []error {
// Hardware and cpu options // Hardware and cpu options
if c.CpuCount < 0 { if c.CpuCount < 0 {
errs = append(errs, fmt.Errorf("An invalid cpu_count was specified (cpu_count < 0): %d", c.CpuCount)) errs = append(errs, fmt.Errorf("An invalid number of cpus was specified (cpus < 0): %d", c.CpuCount))
c.CpuCount = 0 c.CpuCount = 0
} }
if c.CpuCount == 0 { if c.CpuCount == 0 {
@ -30,7 +30,7 @@ func (c *HWConfig) Prepare(ctx *interpolate.Context) []error {
} }
if c.MemorySize < 0 { if c.MemorySize < 0 {
errs = append(errs, fmt.Errorf("An invalid memory_size was specified (memory_size < 0): %d", c.MemorySize)) errs = append(errs, fmt.Errorf("An invalid memory size was specified (memory < 0): %d", c.MemorySize))
c.MemorySize = 0 c.MemorySize = 0
} }
if c.MemorySize == 0 { if c.MemorySize == 0 {

View File

@ -94,7 +94,7 @@ builder.
five seconds and one minute 30 seconds, respectively. If this isn't five seconds and one minute 30 seconds, respectively. If this isn't
specified, the default is `10s` or 10 seconds. specified, the default is `10s` or 10 seconds.
- `cpu_count` (number) - The number of cpus to use for building the VM. - `cpus` (number) - The number of cpus to use for building the VM.
Defaults to building with just one. Defaults to building with just one.
- `disk_size` (number) - The size, in megabytes, of the hard disk to create - `disk_size` (number) - The size, in megabytes, of the hard disk to create
@ -252,7 +252,7 @@ builder.
- `keep_registered` (boolean) - Set this to `true` if you would like to keep - `keep_registered` (boolean) - Set this to `true` if you would like to keep
the VM registered with virtualbox. Defaults to `false`. the VM registered with virtualbox. Defaults to `false`.
- `memory_size` (number) - The amount of memory to use for building the VM - `memory` (number) - The amount of memory to use for building the VM
in megabytes. Defaults to `512` megabytes. in megabytes. Defaults to `512` megabytes.
- `output_directory` (string) - This is the path to the directory where the - `output_directory` (string) - This is the path to the directory where the