Merge pull request #10468 from hashicorp/fix_vsphere_pp

fix regression in return code checking in vsphere postprocessor. this…
This commit is contained in:
Megan Marsh 2021-01-11 13:34:00 -08:00 committed by GitHub
commit c3da09b441
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -202,7 +202,8 @@ func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifa
flattenedCmd := strings.Join(commandAndArgs, " ")
cmd := &packersdk.RemoteCmd{Command: flattenedCmd}
log.Printf("[INFO] (vsphere): starting ovftool command: %s", flattenedCmd)
if err := cmd.RunWithUi(ctx, comm, ui); err != nil {
err = cmd.RunWithUi(ctx, comm, ui)
if err != nil || cmd.ExitStatus() != 0 {
return nil, false, false, fmt.Errorf(
"Error uploading virtual machine: Please see output above for more information.")
}