Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
daa431af
Commit
daa431af
authored
May 12, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packer: Communicator Upload/Download return an error
parent
496a320a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
packer/communicator.go
packer/communicator.go
+2
-2
packer/rpc/communicator.go
packer/rpc/communicator.go
+6
-2
packer/rpc/communicator_test.go
packer/rpc/communicator_test.go
+6
-2
No files found.
packer/communicator.go
View file @
daa431af
...
@@ -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
...
...
packer/rpc/communicator.go
View file @
daa431af
...
@@ -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.
...
...
packer/rpc/communicator_test.go
View file @
daa431af
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment