Merge pull request #4197 from mitchellh/retryondc

provisioner/shell: treat disconnects as retryable.
This commit is contained in:
Matthew Hooker 2016-11-22 16:42:53 -08:00 committed by GitHub
commit f354882282
1 changed files with 4 additions and 0 deletions

View File

@ -320,6 +320,10 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
p.config.RemotePath, err) p.config.RemotePath, err)
} }
cmd.Wait() cmd.Wait()
// treat disconnects as retryable by returning an error
if cmd.ExitStatus == packer.CmdDisconnect {
return fmt.Errorf("Disconnect while removing temporary script.")
}
return nil return nil
}) })
if err != nil { if err != nil {