provisioner/shell: treat disconnects as retryable.

This commit is contained in:
Matthew Hooker 2016-11-22 15:59:38 -08:00
parent 50b7b92b6c
commit 12176b6afc
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
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)
}
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
})
if err != nil {