Skip to content

Commit

Permalink
communicator/ssh: detect if SCP exited with failure [hashicorpGH-386]
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Sep 6, 2013
1 parent 147eea9 commit 81edbb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ IMPROVEMENTS:

BUG FIXES:

* core: Detect if SCP is not enabled on the other side. [GH-386]
* builder/amazon/all: When copying AMI to multiple regions, copy
the metadata (tags and attributes) as well. [GH-388]
* builder/amazon/all: Fix panic case where eventually consistent
Expand Down
6 changes: 4 additions & 2 deletions communicator/ssh/communicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,11 @@ func (c *comm) scpSession(scpCommand string, f func(io.Writer, *bufio.Reader) er
return err
}

// Call our callback that executes in the context of SCP
// Call our callback that executes in the context of SCP. We ignore
// EOF errors if they occur because it usually means that SCP prematurely
// ended on the other side.
log.Println("Started SCP session, beginning transfers...")
if err := f(stdinW, stdoutR); err != nil {
if err := f(stdinW, stdoutR); err != nil && err != io.EOF {
return err
}

Expand Down

0 comments on commit 81edbb4

Please sign in to comment.