make linter happy

This commit is contained in:
Roman Tomjak 2020-07-16 18:19:22 +01:00
parent b0d8f69bda
commit a2220e5f08
No known key found for this signature in database
GPG Key ID: BB29BA0B3501D719
1 changed files with 6 additions and 6 deletions

View File

@ -179,7 +179,7 @@ func (c *Config) Prepare(raws ...interface{}) ([]string, error) {
// (currently zfspool|lvm|rbd|cephfs), the format parameter is mandatory. Make sure this is still up to date // (currently zfspool|lvm|rbd|cephfs), the format parameter is mandatory. Make sure this is still up to date
// when updating the vendored code! // when updating the vendored code!
if !contains([]string{"zfspool", "lvm", "rbd", "cephfs"}, c.Disks[idx].StoragePoolType) && c.Disks[idx].DiskFormat == "" { if !contains([]string{"zfspool", "lvm", "rbd", "cephfs"}, c.Disks[idx].StoragePoolType) && c.Disks[idx].DiskFormat == "" {
errs = packer.MultiErrorAppend(errs, errors.New(fmt.Sprintf("disk format must be specified for pool type %q", c.Disks[idx].StoragePoolType))) errs = packer.MultiErrorAppend(errs, fmt.Errorf("disk format must be specified for pool type %q", c.Disks[idx].StoragePoolType))
} }
} }
if c.SCSIController == "" { if c.SCSIController == "" {
@ -222,7 +222,7 @@ func (c *Config) Prepare(raws ...interface{}) ([]string, error) {
errs = packer.MultiErrorAppend(errs, errors.New("proxmox_url must be specified")) errs = packer.MultiErrorAppend(errs, errors.New("proxmox_url must be specified"))
} }
if c.proxmoxURL, err = url.Parse(c.ProxmoxURLRaw); err != nil { if c.proxmoxURL, err = url.Parse(c.ProxmoxURLRaw); err != nil {
errs = packer.MultiErrorAppend(errs, errors.New(fmt.Sprintf("Could not parse proxmox_url: %s", err))) errs = packer.MultiErrorAppend(errs, fmt.Errorf("Could not parse proxmox_url: %s", err))
} }
if c.Node == "" { if c.Node == "" {
errs = packer.MultiErrorAppend(errs, errors.New("node must be specified")) errs = packer.MultiErrorAppend(errs, errors.New("node must be specified"))
@ -232,18 +232,18 @@ func (c *Config) Prepare(raws ...interface{}) ([]string, error) {
} }
for idx := range c.NICs { for idx := range c.NICs {
if c.NICs[idx].Bridge == "" { if c.NICs[idx].Bridge == "" {
errs = packer.MultiErrorAppend(errs, errors.New(fmt.Sprintf("network_adapters[%d].bridge must be specified", idx))) errs = packer.MultiErrorAppend(errs, fmt.Errorf("network_adapters[%d].bridge must be specified", idx))
} }
if c.NICs[idx].Model != "virtio" && c.NICs[idx].PacketQueues > 0 { if c.NICs[idx].Model != "virtio" && c.NICs[idx].PacketQueues > 0 {
errs = packer.MultiErrorAppend(errs, errors.New(fmt.Sprintf("network_adapters[%d].packet_queues can only be set for 'virtio' driver", idx))) errs = packer.MultiErrorAppend(errs, fmt.Errorf("network_adapters[%d].packet_queues can only be set for 'virtio' driver", idx))
} }
} }
for idx := range c.Disks { for idx := range c.Disks {
if c.Disks[idx].StoragePool == "" { if c.Disks[idx].StoragePool == "" {
errs = packer.MultiErrorAppend(errs, errors.New(fmt.Sprintf("disks[%d].storage_pool must be specified", idx))) errs = packer.MultiErrorAppend(errs, fmt.Errorf("disks[%d].storage_pool must be specified", idx))
} }
if c.Disks[idx].StoragePoolType == "" { if c.Disks[idx].StoragePoolType == "" {
errs = packer.MultiErrorAppend(errs, errors.New(fmt.Sprintf("disks[%d].storage_pool_type must be specified", idx))) errs = packer.MultiErrorAppend(errs, fmt.Errorf("disks[%d].storage_pool_type must be specified", idx))
} }
} }