builder/vmware: Ignore shutdown errors

Resolves issue where `shutdown_command` would error because the remote
side disconnected, which we should have expected and ignored.
This commit is contained in:
Matthew Hooker 2016-10-21 22:41:45 -07:00
parent f9f47c5bbb
commit e9a5d05a2f
1 changed files with 0 additions and 12 deletions

View File

@ -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())