From e9a5d05a2f48d4cb52ef38509b9510778c5370b0 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Fri, 21 Oct 2016 22:41:45 -0700 Subject: [PATCH] builder/vmware: Ignore shutdown errors Resolves issue where `shutdown_command` would error because the remote side disconnected, which we should have expected and ignored. --- builder/vmware/common/step_shutdown.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/builder/vmware/common/step_shutdown.go b/builder/vmware/common/step_shutdown.go index 7ff443152..387e59663 100644 --- a/builder/vmware/common/step_shutdown.go +++ b/builder/vmware/common/step_shutdown.go @@ -57,18 +57,6 @@ func (s *StepShutdown) Run(state multistep.StateBag) multistep.StepAction { return multistep.ActionHalt } - // Wait for the command to run - cmd.Wait() - - // If the command failed to run, notify the user in some way. - // Ignores disconnect errors. - if cmd.ExitStatus != packer.CmdDisconnect && cmd.ExitStatus != 0 { - state.Put("error", fmt.Errorf( - "Shutdown command has non-zero exit status.\n\nStdout: %s\n\nStderr: %s", - stdout.String(), stderr.String())) - return multistep.ActionHalt - } - log.Printf("Shutdown stdout: %s", stdout.String()) log.Printf("Shutdown stderr: %s", stderr.String())