diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d2539247..dcb835f15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ BUG FIXES: * builders/docker: user variables work properly. [GH-777] +* builder/virtualbox,vmware: iso\_checksum is not required if the + checksum type is "none" ## 0.5.1 (01/02/2014) diff --git a/builder/virtualbox/iso/builder.go b/builder/virtualbox/iso/builder.go index 1e11e9876..14e5daf65 100644 --- a/builder/virtualbox/iso/builder.go +++ b/builder/virtualbox/iso/builder.go @@ -175,19 +175,19 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { errs, errors.New("http_port_min must be less than http_port_max")) } - if b.config.ISOChecksum == "" { - errs = packer.MultiErrorAppend( - errs, errors.New("Due to large file sizes, an iso_checksum is required")) - } else { - b.config.ISOChecksum = strings.ToLower(b.config.ISOChecksum) - } - if b.config.ISOChecksumType == "" { errs = packer.MultiErrorAppend( errs, errors.New("The iso_checksum_type must be specified.")) } else { b.config.ISOChecksumType = strings.ToLower(b.config.ISOChecksumType) if b.config.ISOChecksumType != "none" { + if b.config.ISOChecksum == "" { + errs = packer.MultiErrorAppend( + errs, errors.New("Due to large file sizes, an iso_checksum is required")) + } else { + b.config.ISOChecksum = strings.ToLower(b.config.ISOChecksum) + } + if h := common.HashForType(b.config.ISOChecksumType); h == nil { errs = packer.MultiErrorAppend( errs, diff --git a/builder/vmware/iso/builder.go b/builder/vmware/iso/builder.go index 9be70d4ce..06884ad89 100644 --- a/builder/vmware/iso/builder.go +++ b/builder/vmware/iso/builder.go @@ -206,19 +206,19 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { errs, errors.New("http_port_min must be less than http_port_max")) } - if b.config.ISOChecksum == "" { - errs = packer.MultiErrorAppend( - errs, errors.New("Due to large file sizes, an iso_checksum is required")) - } else { - b.config.ISOChecksum = strings.ToLower(b.config.ISOChecksum) - } - if b.config.ISOChecksumType == "" { errs = packer.MultiErrorAppend( errs, errors.New("The iso_checksum_type must be specified.")) } else { b.config.ISOChecksumType = strings.ToLower(b.config.ISOChecksumType) if b.config.ISOChecksumType != "none" { + if b.config.ISOChecksum == "" { + errs = packer.MultiErrorAppend( + errs, errors.New("Due to large file sizes, an iso_checksum is required")) + } else { + b.config.ISOChecksum = strings.ToLower(b.config.ISOChecksum) + } + if h := common.HashForType(b.config.ISOChecksumType); h == nil { errs = packer.MultiErrorAppend( errs,