fix shell disconnect error when shutting down vmware

This commit is contained in:
Matthew Hooker 2016-10-21 22:26:34 -07:00
parent 06f71f3501
commit f9f47c5bbb
1 changed files with 2 additions and 1 deletions

View File

@ -61,7 +61,8 @@ func (s *StepShutdown) Run(state multistep.StateBag) multistep.StepAction {
cmd.Wait()
// If the command failed to run, notify the user in some way.
if cmd.ExitStatus != 0 {
// 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()))