From 286b7836fada507be90b3dd5f66ec2362ecf2652 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Wed, 5 Oct 2016 18:17:02 -0700 Subject: [PATCH] remove dead code. continues work from a629f1655b3ded11a628422b278b85c2b8ee2969 --- communicator/ssh/communicator.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index 65c59794e..c96603560 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -13,7 +13,6 @@ import ( "path/filepath" "strconv" "strings" - "sync" "time" "github.com/mitchellh/packer/packer" @@ -105,11 +104,6 @@ func (c *comm) Start(cmd *packer.RemoteCmd) (err error) { return } - // A channel to keep track of our done state - doneCh := make(chan struct{}) - sessionLock := new(sync.Mutex) - timedOut := false - // Start a goroutine to wait for the session to end and set the // exit boolean and status. go func() { @@ -130,18 +124,7 @@ func (c *comm) Start(cmd *packer.RemoteCmd) (err error) { exitStatus = -1 } } - - sessionLock.Lock() - defer sessionLock.Unlock() - - if timedOut { - // We timed out, so set the exit status to -1 - exitStatus = -1 - } - - log.Printf("remote command exited with '%d': %s", exitStatus, cmd.Command) cmd.SetExited(exitStatus) - close(doneCh) }() return