From d6bed794293b8794ff9c34d277722efc7a35588e Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Sat, 22 Oct 2016 10:33:27 -0700 Subject: [PATCH] wait for shutdown command to end so we get stderr/out --- builder/vmware/common/step_shutdown.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/builder/vmware/common/step_shutdown.go b/builder/vmware/common/step_shutdown.go index 387e59663..666649993 100644 --- a/builder/vmware/common/step_shutdown.go +++ b/builder/vmware/common/step_shutdown.go @@ -57,6 +57,11 @@ func (s *StepShutdown) Run(state multistep.StateBag) multistep.StepAction { return multistep.ActionHalt } + // Wait for the command to run so we can print std{err,out} + // We don't care if the command errored, since we'll notice + // if the vm didn't shut down. + cmd.Wait() + log.Printf("Shutdown stdout: %s", stdout.String()) log.Printf("Shutdown stderr: %s", stderr.String())