Merge pull request #5165 from bennu/esxi-remote-cache

vmware-iso:esxi5 using ISO files uploaded by packer to datastore
This commit is contained in:
Megan Marsh 2018-08-06 14:31:19 -07:00 committed by GitHub
commit 5585855265
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -36,6 +36,17 @@ func (s *stepRemoteUpload) Run(_ context.Context, state multistep.StateBag) mult
checksum := config.ISOChecksum
checksumType := config.ISOChecksumType
if esx5, ok := remote.(*ESX5Driver); ok {
remotePath := esx5.cachePath(path)
if esx5.verifyChecksum(checksumType, checksum, remotePath) {
ui.Say("Remote cache was verified skipping remote upload...")
state.Put(s.Key, remotePath)
return multistep.ActionContinue
}
}
ui.Say(s.Message)
log.Printf("Remote uploading: %s", path)
newPath, err := remote.UploadISO(path, checksum, checksumType)
@ -45,8 +56,8 @@ func (s *stepRemoteUpload) Run(_ context.Context, state multistep.StateBag) mult
ui.Error(err.Error())
return multistep.ActionHalt
}
state.Put(s.Key, newPath)
return multistep.ActionContinue
}