Skip to content

Commit

Permalink
move next to similar existing validation for cdfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
mpywell authored and lbajolet-hashicorp committed Feb 2, 2024
1 parent b294dfe commit e84be26
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions builder/proxmox/common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,6 @@ func (c *Config) Prepare(upper interface{}, raws ...interface{}) ([]string, []st
}
c.AdditionalISOFiles[idx].ShouldUploadISO = true
}
if len(c.AdditionalISOFiles[idx].ISOUrls) != 0 && c.AdditionalISOFiles[idx].ISOStoragePool == "" {
errs = packersdk.MultiErrorAppend(errs, errors.New("when specifying iso_url in an additional_iso_files block, iso_storage_pool must also be specified"))
}
if c.AdditionalISOFiles[idx].Device == "" {
log.Printf("AdditionalISOFile %d Device not set, using default 'ide3'", idx)
c.AdditionalISOFiles[idx].Device = "ide3"
Expand Down Expand Up @@ -755,6 +752,9 @@ func (c *Config) Prepare(upper interface{}, raws ...interface{}) ([]string, []st
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("iso_storage_pool not set for storage of generated ISO from cd_files or cd_content"))
}
}
if len(c.AdditionalISOFiles[idx].ISOUrls) != 0 && c.AdditionalISOFiles[idx].ISOStoragePool == "" {
errs = packersdk.MultiErrorAppend(errs, errors.New("when specifying iso_url in an additional_iso_files block, iso_storage_pool must also be specified"))
}
// Check only one option is present
options := 0
if c.AdditionalISOFiles[idx].ISOFile != "" {
Expand Down

0 comments on commit e84be26

Please sign in to comment.