Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
rajagopalans committed Sep 12, 2023
1 parent 564448b commit 57f88f0
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions apstra/test_utils/blueprint_configlet.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ package testutils

import (
"context"
"fmt"
"github.com/Juniper/apstra-go-sdk/apstra"
"github.com/Juniper/terraform-provider-apstra/apstra/blueprint"
"github.com/Juniper/terraform-provider-apstra/apstra/design"
"github.com/Juniper/terraform-provider-apstra/apstra/utils"
"github.com/hashicorp/terraform-plugin-framework/diag"
)

func CatalogConfigletA(ctx context.Context, client *apstra.Client) (apstra.ObjectId, *apstra.ConfigletData,
Expand Down Expand Up @@ -40,32 +36,6 @@ func CatalogConfigletA(ctx context.Context, client *apstra.Client) (apstra.Objec
return c.Id, c.Data, deleteFunc, nil
}

func ConfigletMatch(ctx context.Context, c1 apstra.ConfigletData, condition string, c2 blueprint.DatacenterConfiglet) (bool,
string, diag.Diagnostics) {
if condition != c2.Condition.ValueString() {
return false, "condition does not match", nil
}
if c1.DisplayName != c2.Name.ValueString() {
return false, "name does not match", nil
}

tfGenerators := make([]design.ConfigletGenerator, len(c2.Generators.Elements()))
d := c2.Generators.ElementsAs(ctx, &tfGenerators, false)
if d.HasError() {
return false, "unable to parse generators", d
}
var g apstra.ConfigletGenerator
for i, j := range tfGenerators {
g = c1.Generators[i]
if j.Section.ValueString() != g.Section.String() || j.TemplateText.ValueString() != g.TemplateText || j.
NegationTemplateText.ValueString() != g.NegationTemplateText || j.ConfigStyle.ValueString() != g.
ConfigStyle.String() || j.FileName.String() != g.Filename {
return false, fmt.Sprintf("Generator %d does not match %q %q", j, g, j), nil
}
}
return true, "", nil
}

func BlueprintConfigletA(ctx context.Context, client *apstra.TwoStageL3ClosClient,
cid apstra.ObjectId, condition string) (apstra.ObjectId,
func(context.Context, apstra.ObjectId) error, error) {
Expand Down

0 comments on commit 57f88f0

Please sign in to comment.