Skip to content

Commit

Permalink
Merge pull request #939 from Juniper/937-resourcedeviceallocationupda…
Browse files Browse the repository at this point in the history
…te-calls-plangetsystemattributes-twice

Remove redundant `plan.GetSystemAttributes()` call in `resourceDeviceAllocation.Update()`
  • Loading branch information
chrismarget-j authored Oct 20, 2024
2 parents b3f5806 + 1f4f991 commit 13ffb24
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions apstra/resource_datacenter_device_allocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,11 @@ func (o *resourceDeviceAllocation) Update(ctx context.Context, req resource.Upda
return
}

// read back any apstra-assigned attributes
// read back any apstra-assigned attributes; copy them to the state
plan.GetSystemAttributes(ctx, bp, &resp.Diagnostics)
if resp.Diagnostics.HasError() {
return
}

// read and save any apstra-assigned values
plan.GetSystemAttributes(ctx, bp, &resp.Diagnostics)
state.SystemAttributes = plan.SystemAttributes

// copy the deploy mode to the deprecated root-level attribute
Expand Down

0 comments on commit 13ffb24

Please sign in to comment.