diff --git a/rpc/resource_provisioner.go b/rpc/resource_provisioner.go index 82552cf4f..171cf9f0a 100644 --- a/rpc/resource_provisioner.go +++ b/rpc/resource_provisioner.go @@ -37,7 +37,7 @@ func (p *ResourceProvisioner) Validate(c *terraform.ResourceConfig) ([]string, [ func (p *ResourceProvisioner) Apply( s *terraform.ResourceState, - c *terraform.ResourceConfig) (*terraform.ResourceState, error) { + c *terraform.ResourceConfig) error { var resp ResourceProvisionerApplyResponse args := &ResourceProvisionerApplyArgs{ State: s, @@ -46,13 +46,13 @@ func (p *ResourceProvisioner) Apply( err := p.Client.Call(p.Name+".Apply", args, &resp) if err != nil { - return nil, err + return err } if resp.Error != nil { err = resp.Error } - return resp.State, err + return err } type ResourceProvisionerValidateArgs struct { @@ -70,7 +70,6 @@ type ResourceProvisionerApplyArgs struct { } type ResourceProvisionerApplyResponse struct { - State *terraform.ResourceState Error *BasicError } @@ -83,9 +82,8 @@ type ResourceProvisionerServer struct { func (s *ResourceProvisionerServer) Apply( args *ResourceProvisionerApplyArgs, result *ResourceProvisionerApplyResponse) error { - state, err := s.Provisioner.Apply(args.State, args.Config) + err := s.Provisioner.Apply(args.State, args.Config) *result = ResourceProvisionerApplyResponse{ - State: state, Error: NewBasicError(err), } return nil diff --git a/rpc/resource_provisioner_test.go b/rpc/resource_provisioner_test.go index 73f11eb9a..e31db8dc4 100644 --- a/rpc/resource_provisioner_test.go +++ b/rpc/resource_provisioner_test.go @@ -21,14 +21,10 @@ func TestResourceProvisioner_apply(t *testing.T) { } provisioner := &ResourceProvisioner{Client: client, Name: name} - p.ApplyReturn = &terraform.ResourceState{ - ID: "bob", - } - // Apply state := &terraform.ResourceState{} conf := &terraform.ResourceConfig{} - newState, err := provisioner.Apply(state, conf) + err = provisioner.Apply(state, conf) if !p.ApplyCalled { t.Fatal("apply should be called") } @@ -38,9 +34,6 @@ func TestResourceProvisioner_apply(t *testing.T) { if err != nil { t.Fatalf("bad: %#v", err) } - if !reflect.DeepEqual(p.ApplyReturn, newState) { - t.Fatalf("bad: %#v", newState) - } } func TestResourceProvisioner_validate(t *testing.T) {