Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AP and CT IDs to application point assignment error text #940

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (o *resourceDatacenterConnectivityTemplateAssignments) Create(ctx context.C
err = bp.SetApplicationPointsConnectivityTemplates(ctx, request)
if err != nil {
resp.Diagnostics.AddError(
fmt.Sprintf("failed while assigning Connectivity Template %s to Application Points", plan.ConnectivityTemplateId),
fmt.Sprintf("failed while assigning Connectivity Template %s to Application Points %s", plan.ConnectivityTemplateId, plan.ApplicationPointIds),
err.Error())
}

Expand Down Expand Up @@ -182,7 +182,7 @@ func (o *resourceDatacenterConnectivityTemplateAssignments) Update(ctx context.C
err = bp.SetApplicationPointsConnectivityTemplates(ctx, request)
if err != nil {
resp.Diagnostics.AddError(
fmt.Sprintf("failed while assigning Connectivity Template %s to Application Points", plan.ConnectivityTemplateId),
fmt.Sprintf("failed while assigning Connectivity Template %s to Application Points %s", plan.ConnectivityTemplateId, plan.ApplicationPointIds),
err.Error())
}

Expand Down
10 changes: 8 additions & 2 deletions apstra/resource_datacenter_connectivity_templates_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ func (o *resourceDatacenterConnectivityTemplatesAssignment) Create(ctx context.C
addIds, _ := plan.AddDelRequest(ctx, nil, &resp.Diagnostics)
err = bp.SetApplicationPointConnectivityTemplates(ctx, apstra.ObjectId(plan.ApplicationPointId.ValueString()), addIds)
if err != nil {
resp.Diagnostics.AddError("failed applying Connectivity Template", err.Error())
resp.Diagnostics.AddError(
fmt.Sprintf("failed while assigning Connectivity Templates %s to Application Point %s", plan.ConnectivityTemplateIds, plan.ApplicationPointId),
err.Error(),
)
return
}

Expand Down Expand Up @@ -178,7 +181,10 @@ func (o *resourceDatacenterConnectivityTemplatesAssignment) Update(ctx context.C
// add any required CTs
err = bp.SetApplicationPointConnectivityTemplates(ctx, apstra.ObjectId(plan.ApplicationPointId.ValueString()), addIds)
if err != nil {
resp.Diagnostics.AddError("failed assigning connectivity templates", err.Error())
resp.Diagnostics.AddError(
fmt.Sprintf("failed while assigning Connectivity Templates %s to Application Point %s", plan.ConnectivityTemplateIds, plan.ApplicationPointId),
err.Error(),
)
return
}

Expand Down
Loading