Commit 3ac246d6 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer/rpc: don't reply with arbitrary error

parent 8cdd784e
...@@ -26,7 +26,7 @@ type ProvisionerPrepareArgs struct { ...@@ -26,7 +26,7 @@ type ProvisionerPrepareArgs struct {
func (p *provisioner) Prepare(configs ...interface{}) (err error) { func (p *provisioner) Prepare(configs ...interface{}) (err error) {
args := &ProvisionerPrepareArgs{configs} args := &ProvisionerPrepareArgs{configs}
if cerr := p.client.Call("Provisioner.Prepare", args, &err); cerr != nil { if cerr := p.client.Call("Provisioner.Prepare", args, new(interface{})); cerr != nil {
err = cerr err = cerr
} }
...@@ -50,13 +50,8 @@ func (p *provisioner) Cancel() { ...@@ -50,13 +50,8 @@ func (p *provisioner) Cancel() {
} }
} }
func (p *ProvisionerServer) Prepare(args *ProvisionerPrepareArgs, reply *error) error { func (p *ProvisionerServer) Prepare(args *ProvisionerPrepareArgs, reply *interface{}) error {
*reply = p.p.Prepare(args.Configs...) return p.p.Prepare(args.Configs...)
if *reply != nil {
*reply = NewBasicError(*reply)
}
return nil
} }
func (p *ProvisionerServer) Provision(streamId uint32, reply *interface{}) error { func (p *ProvisionerServer) Provision(streamId uint32, reply *interface{}) error {
......
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