Commit ee6fd494 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

communicator/ssh: show more descriptive error if SCP not avail [GH-127]

parent 5ba5834a
......@@ -9,6 +9,8 @@ FEATURES:
IMPROVEMENTS:
* core: If SCP is not available, a more descriptive error message
is shown telling the user. [GH-127]
* virtualbox: Delete the packer-made SSH port forwarding prior to
exporting the VM.
......
......@@ -3,6 +3,7 @@ package ssh
import (
"bytes"
"code.google.com/p/go.crypto/ssh"
"errors"
"fmt"
"github.com/mitchellh/packer/packer"
"io"
......@@ -145,6 +146,14 @@ func (c *comm) Upload(path string, input io.Reader) error {
// Otherwise, we have an ExitErorr, meaning we can just read
// the exit status
log.Printf("non-zero exit status: %d", exitErr.ExitStatus())
// If we exited with status 127, it means SCP isn't available.
// Return a more descriptive error for that.
if exitErr.ExitStatus() == 127 {
return errors.New(
"SCP failed to start. This usually means that SCP is not\n" +
"properly installed on the remote system.")
}
}
return err
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment