From 374f82b978ffb892c1676718fdce4c92df261627 Mon Sep 17 00:00:00 2001 From: RedTail72 Date: Mon, 1 Jun 2020 15:27:26 -0400 Subject: [PATCH] buidler/vsphere-iso: ISOUrl Fix (#9321) * ISOUrl Fix Added the check for ISOUrls back in addition to a check for RawSingleISOUrl. This should allow both ISOUrls[] or ISOUrl to work while not requiring them all the time. * Update config.go Fixed formatting. --- builder/vsphere/iso/config.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/builder/vsphere/iso/config.go b/builder/vsphere/iso/config.go index aee0fe14f..7be966781 100644 --- a/builder/vsphere/iso/config.go +++ b/builder/vsphere/iso/config.go @@ -63,9 +63,11 @@ func (c *Config) Prepare(raws ...interface{}) ([]string, error) { warnings := make([]string, 0) errs := new(packer.MultiError) - isoWarnings, isoErrs := c.ISOConfig.Prepare(&c.ctx) - warnings = append(warnings, isoWarnings...) - errs = packer.MultiErrorAppend(errs, isoErrs...) + if c.ISOUrls != nil || c.RawSingleISOUrl != "" { + isoWarnings, isoErrs := c.ISOConfig.Prepare(&c.ctx) + warnings = append(warnings, isoWarnings...) + errs = packer.MultiErrorAppend(errs, isoErrs...) + } errs = packer.MultiErrorAppend(errs, c.ConnectConfig.Prepare()...) errs = packer.MultiErrorAppend(errs, c.CreateConfig.Prepare()...)