Commit daa431af authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer: Communicator Upload/Download return an error

parent 496a320a
...@@ -13,8 +13,8 @@ import ( ...@@ -13,8 +13,8 @@ import (
// Start or any other method may be called at the same time. // Start or any other method may be called at the same time.
type Communicator interface { type Communicator interface {
Start(string) (*RemoteCommand, error) Start(string) (*RemoteCommand, error)
Upload(string, io.Reader) Upload(string, io.Reader) error
Download(string, io.Writer) Download(string, io.Writer) error
} }
// This struct contains some information about the remote command being // 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) { ...@@ -87,9 +87,13 @@ func (c *communicator) Start(cmd string) (rc *packer.RemoteCommand, err error) {
return 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) { func (c *CommunicatorServer) Start(cmd *string, reply *CommunicatorStartResponse) (err error) {
// Start executing the command. // Start executing the command.
......
...@@ -45,9 +45,13 @@ func (t *testCommunicator) Start(cmd string) (*packer.RemoteCommand, error) { ...@@ -45,9 +45,13 @@ func (t *testCommunicator) Start(cmd string) (*packer.RemoteCommand, error) {
return rc, nil 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) { func TestCommunicatorRPC(t *testing.T) {
assert := asserts.NewTestingAsserts(t, true) assert := asserts.NewTestingAsserts(t, true)
......
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