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
32536b25
Commit
32536b25
authored
Apr 28, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packer/rpc: fix interface returns for msgpack [GH-1076]
parent
7a8372db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
17 deletions
+13
-17
packer/rpc/build.go
packer/rpc/build.go
+7
-3
packer/rpc/post_processor.go
packer/rpc/post_processor.go
+6
-14
No files found.
packer/rpc/build.go
View file @
32536b25
...
...
@@ -21,7 +21,7 @@ type BuildServer struct {
type
BuildPrepareResponse
struct
{
Warnings
[]
string
Error
e
rror
Error
*
BasicE
rror
}
func
(
b
*
build
)
Name
()
(
result
string
)
{
...
...
@@ -34,8 +34,12 @@ func (b *build) Prepare() ([]string, error) {
if
cerr
:=
b
.
client
.
Call
(
"Build.Prepare"
,
new
(
interface
{}),
&
resp
);
cerr
!=
nil
{
return
nil
,
cerr
}
var
err
error
=
nil
if
resp
.
Error
!=
nil
{
err
=
resp
.
Error
}
return
resp
.
Warnings
,
resp
.
Erro
r
return
resp
.
Warnings
,
er
r
}
func
(
b
*
build
)
Run
(
ui
packer
.
Ui
,
cache
packer
.
Cache
)
([]
packer
.
Artifact
,
error
)
{
...
...
@@ -90,7 +94,7 @@ func (b *BuildServer) Prepare(args *interface{}, resp *BuildPrepareResponse) err
warnings
,
err
:=
b
.
build
.
Prepare
()
*
resp
=
BuildPrepareResponse
{
Warnings
:
warnings
,
Error
:
err
,
Error
:
NewBasicError
(
err
)
,
}
return
nil
}
...
...
packer/rpc/post_processor.go
View file @
32536b25
...
...
@@ -25,14 +25,14 @@ type PostProcessorConfigureArgs struct {
}
type
PostProcessorProcessResponse
struct
{
Err
e
rror
Err
*
BasicE
rror
Keep
bool
StreamId
uint32
}
func
(
p
*
postProcessor
)
Configure
(
raw
...
interface
{})
(
err
error
)
{
args
:=
&
PostProcessorConfigureArgs
{
Configs
:
raw
}
if
cerr
:=
p
.
client
.
Call
(
"PostProcessor.Configure"
,
args
,
&
err
);
cerr
!=
nil
{
if
cerr
:=
p
.
client
.
Call
(
"PostProcessor.Configure"
,
args
,
new
(
interface
{})
);
cerr
!=
nil
{
err
=
cerr
}
...
...
@@ -67,13 +67,9 @@ func (p *postProcessor) PostProcess(ui packer.Ui, a packer.Artifact) (packer.Art
return
client
.
Artifact
(),
response
.
Keep
,
nil
}
func
(
p
*
PostProcessorServer
)
Configure
(
args
*
PostProcessorConfigureArgs
,
reply
*
error
)
error
{
*
reply
=
p
.
p
.
Configure
(
args
.
Configs
...
)
if
*
reply
!=
nil
{
*
reply
=
NewBasicError
(
*
reply
)
}
return
nil
func
(
p
*
PostProcessorServer
)
Configure
(
args
*
PostProcessorConfigureArgs
,
reply
*
interface
{})
error
{
err
:=
p
.
p
.
Configure
(
args
.
Configs
...
)
return
err
}
func
(
p
*
PostProcessorServer
)
PostProcess
(
streamId
uint32
,
reply
*
PostProcessorProcessResponse
)
error
{
...
...
@@ -92,12 +88,8 @@ func (p *PostProcessorServer) PostProcess(streamId uint32, reply *PostProcessorP
go
server
.
Serve
()
}
if
err
!=
nil
{
err
=
NewBasicError
(
err
)
}
*
reply
=
PostProcessorProcessResponse
{
Err
:
err
,
Err
:
NewBasicError
(
err
)
,
Keep
:
keep
,
StreamId
:
streamId
,
}
...
...
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