Skip to content

Commit

Permalink
bump SDK version for improved error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismarget-j committed Apr 30, 2024
1 parent 9f3fb7b commit 17f5ad3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions apstra/blueprint/datacenter_generic_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,14 +523,14 @@ func (o *DatacenterGenericSystem) deleteLinksFromSystem(ctx context.Context, lin
return
}

// try to delete the links
err := bp.DeleteLinksFromSystem(ctx, linkIdsToDelete)
if err == nil {
return // success!
}

var ace apstra.ClientErr

// see if we can handle this error...
var ace apstra.ClientErr
if !errors.As(err, &ace) || ace.Type() != apstra.ErrCtAssignedToLink || ace.Detail() == nil {
// cannot handle error
diags.AddError("failed while deleting Links from Generic System", err.Error())
Expand Down Expand Up @@ -562,7 +562,6 @@ func (o *DatacenterGenericSystem) deleteLinksFromSystem(ctx context.Context, lin
fmt.Sprintf("failed deleting links %v from generic system %s", linkIdsToDelete, o.Id),
err.Error())

// we got here because some links have CTs attached.
// try to clear the connectivity templates from the problem links
o.ClearConnectivityTemplatesFromLinks(ctx, ace.Detail().(apstra.ErrCtAssignedToLinkDetail).LinkIds, bp, diags)
if diags.HasError() {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ module github.com/Juniper/terraform-provider-apstra

go 1.21

// replace github.com/Juniper/apstra-go-sdk => ../apstra-go-sdk
//replace github.com/Juniper/apstra-go-sdk => ../apstra-go-sdk

toolchain go1.21.1

require (
github.com/IBM/netaddr v1.5.0
github.com/Juniper/apstra-go-sdk v0.0.0-20240426215444-33c962e3c277
github.com/Juniper/apstra-go-sdk v0.0.0-20240430192907-3b8e9f7648cf
github.com/chrismarget-j/go-licenses v0.0.0-20240224210557-f22f3e06d3d4
github.com/google/go-cmp v0.6.0
github.com/goreleaser/goreleaser v1.23.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=
github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
github.com/IBM/netaddr v1.5.0 h1:IJlFZe1+nFs09TeMB/HOP4+xBnX2iM/xgiDOgZgTJq0=
github.com/IBM/netaddr v1.5.0/go.mod h1:DDBPeYgbFzoXHjSz9Jwk7K8wmWV4+a/Kv0LqRnb8we4=
github.com/Juniper/apstra-go-sdk v0.0.0-20240426215444-33c962e3c277 h1:2h6VCKACnTqVFmYI0OgC77CvhLd9nTMdK1NDwUDA4ks=
github.com/Juniper/apstra-go-sdk v0.0.0-20240426215444-33c962e3c277/go.mod h1:Xwj3X8v/jRZWv28o6vQAqD4lz2JmzaSYLZ2ch1SS89w=
github.com/Juniper/apstra-go-sdk v0.0.0-20240430192907-3b8e9f7648cf h1:4PVRSN7ChmQDy1oTjpGcVXqL3hohO+1N9NBCuMxDN5M=
github.com/Juniper/apstra-go-sdk v0.0.0-20240430192907-3b8e9f7648cf/go.mod h1:Xwj3X8v/jRZWv28o6vQAqD4lz2JmzaSYLZ2ch1SS89w=
github.com/Kunde21/markdownfmt/v3 v3.1.0 h1:KiZu9LKs+wFFBQKhrZJrFZwtLnCCWJahL+S+E/3VnM0=
github.com/Kunde21/markdownfmt/v3 v3.1.0/go.mod h1:tPXN1RTyOzJwhfHoon9wUr4HGYmWgVxSQN6VBJDkrVc=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
Expand Down

0 comments on commit 17f5ad3

Please sign in to comment.