packer: Communicator Upload/Download return an error
This commit is contained in:
parent
496a320a82
commit
daa431af63
@ -13,8 +13,8 @@ import (
|
||||
// Start or any other method may be called at the same time.
|
||||
type Communicator interface {
|
||||
Start(string) (*RemoteCommand, error)
|
||||
Upload(string, io.Reader)
|
||||
Download(string, io.Writer)
|
||||
Upload(string, io.Reader) error
|
||||
Download(string, io.Writer) error
|
||||
}
|
||||
|
||||
// This struct contains some information about the remote command being
|
||||
|
@ -87,9 +87,13 @@ func (c *communicator) Start(cmd string) (rc *packer.RemoteCommand, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (c *communicator) Upload(string, io.Reader) {}
|
||||
func (c *communicator) Upload(string, io.Reader) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *communicator) Download(string, io.Writer) {}
|
||||
func (c *communicator) Download(string, io.Writer) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *CommunicatorServer) Start(cmd *string, reply *CommunicatorStartResponse) (err error) {
|
||||
// Start executing the command.
|
||||
|
@ -45,9 +45,13 @@ func (t *testCommunicator) Start(cmd string) (*packer.RemoteCommand, error) {
|
||||
return rc, nil
|
||||
}
|
||||
|
||||
func (t *testCommunicator) Upload(string, io.Reader) {}
|
||||
func (t *testCommunicator) Upload(string, io.Reader) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *testCommunicator) Download(string, io.Writer) {}
|
||||
func (t *testCommunicator) Download(string, io.Writer) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func TestCommunicatorRPC(t *testing.T) {
|
||||
assert := asserts.NewTestingAsserts(t, true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user