From 69178662592a8dea8fc330bd057e7d503dcd0c83 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Mon, 11 Jan 2021 13:12:24 -0800 Subject: [PATCH] fix regression in return code checking in vsphere postprocessor. this was introduced in v1.6.1 --- post-processor/vsphere/post-processor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/post-processor/vsphere/post-processor.go b/post-processor/vsphere/post-processor.go index 634d93016..827ad7273 100644 --- a/post-processor/vsphere/post-processor.go +++ b/post-processor/vsphere/post-processor.go @@ -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.") }