Merge pull request #9320 from hashicorp/fix_checksum_fixer

actually run the fixer
This commit is contained in:
Wilken Rivera 2020-05-29 11:38:00 -04:00 committed by GitHub
commit 37df64873f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -50,6 +50,7 @@ func init() {
"ssh-wait-timeout": new(FixerSSHTimout),
"docker-tag-tags": new(FixerDockerTagtoTags),
"vsphere-iso-net-disk": new(FixerVSphereNetworkDisk),
"iso-checksum-type-and-url": new(FixerISOChecksumTypeAndURL),
}
FixerOrder = []string{
@ -83,5 +84,6 @@ func init() {
"comm-config",
"ssh-wait-timeout",
"vsphere-iso-net-disk",
"iso-checksum-type-and-url",
}
}

View File

@ -27,7 +27,9 @@ func (FixerISOChecksumTypeAndURL) Fix(input map[string]interface{}) (map[string]
checksum := stringValue(builder["iso_checksum"])
delete(builder, "iso_checksum_url")
delete(builder, "iso_checksum_type")
if checksum == "" && checksumUrl == "" {
continue
}
if checksumUrl != "" {
checksum = "file:" + checksumUrl
} else if checksumType != "" {