From 33995b08a5bc1700fa838f4016a7242185eac247 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Fri, 14 Oct 2016 11:41:28 -0700 Subject: [PATCH] Only treat ssh exit errors as errors --- communicator/ssh/communicator.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index bc4d0f40b24..5eea78983e7 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -115,13 +115,14 @@ func (c *comm) Start(cmd *packer.RemoteCmd) (err error) { switch err.(type) { case *ssh.ExitError: exitStatus = err.(*ssh.ExitError).ExitStatus() - log.Printf("Remote command exited with '%d': %s", exitStatus, cmd.Command) + log.Printf("Remote command exited with '%d': %s", + exitStatus, cmd.Command) case *ssh.ExitMissingError: - log.Printf("Remote command exited without exit status or exit signal.") - exitStatus = -1 + log.Printf("Remote command exited without exit status or " + + "exit signal. If your ssh server restarted intentionally, " + + "you can safely ignore this. Continuing.") default: - log.Printf("Error occurred waiting for ssh session: %s", err.Error()) - exitStatus = -1 + log.Printf("Error occurred waiting for ssh session: %s. Continuing.", err.Error()) } } cmd.SetExited(exitStatus)