packer/rpc: when communicator abruptly exits, set exit status 123

This commit is contained in:
Mitchell Hashimoto 2013-08-19 23:21:53 -07:00
parent 6e99c468d4
commit 29ede35b28
1 changed files with 4 additions and 2 deletions

View File

@ -78,7 +78,8 @@ func (c *communicator) Start(cmd *packer.RemoteCmd) (err error) {
conn, err := responseL.Accept()
if err != nil {
log.Panic(err)
cmd.SetExited(123)
return
}
defer conn.Close()
@ -87,7 +88,8 @@ func (c *communicator) Start(cmd *packer.RemoteCmd) (err error) {
var finished CommandFinished
if err := decoder.Decode(&finished); err != nil {
log.Panic(err)
cmd.SetExited(123)
return
}
cmd.SetExited(finished.ExitStatus)