remove dead code.

continues work from a629f1655b
This commit is contained in:
Matthew Hooker 2016-10-05 18:17:02 -07:00
parent 5ab19ea469
commit 286b7836fa
1 changed files with 0 additions and 17 deletions

View File

@ -13,7 +13,6 @@ import (
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings" "strings"
"sync"
"time" "time"
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
@ -105,11 +104,6 @@ func (c *comm) Start(cmd *packer.RemoteCmd) (err error) {
return 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 // Start a goroutine to wait for the session to end and set the
// exit boolean and status. // exit boolean and status.
go func() { go func() {
@ -130,18 +124,7 @@ func (c *comm) Start(cmd *packer.RemoteCmd) (err error) {
exitStatus = -1 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) cmd.SetExited(exitStatus)
close(doneCh)
}() }()
return return