Merge pull request #8799 from carlpett/proxmox/validate-template-name

proxmox: template_name cannot contain spaces
This commit is contained in:
Megan Marsh 2020-02-28 11:19:18 -08:00 committed by GitHub
commit 6d59cbd4b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import (
"log"
"net/url"
"os"
"strings"
"time"
"github.com/hashicorp/packer/common"
@ -213,6 +214,9 @@ func (c *Config) Prepare(raws ...interface{}) ([]string, error) {
if c.Node == "" {
errs = packer.MultiErrorAppend(errs, errors.New("node must be specified"))
}
if strings.ContainsAny(c.TemplateName, " ") {
errs = packer.MultiErrorAppend(errs, errors.New("template_name must not contain spaces"))
}
for idx := range c.NICs {
if c.NICs[idx].Bridge == "" {
errs = packer.MultiErrorAppend(errs, errors.New(fmt.Sprintf("network_adapters[%d].bridge must be specified", idx)))