Skip to content
Open
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
11 changes: 11 additions & 0 deletions internal/provider/cisco/nxos/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1662,6 +1662,17 @@ func (p *Provider) EnsurePIM(ctx context.Context, req *provider.EnsurePIMRequest
del := make([]gnmiext.Configurable, 0, 3)

if len(rpItems.StaticRPList) > 0 {
// NX-OS fails with "child (Rn) cannot be added to deleted object" when a
// gNMI Replace tries to update nested rpgrplist-items within a StaticRP
// in the same transaction (e.g. when multicastGroups change). Work around
// this by deleting the existing StaticRPItems first when the configuration
// has changed, so the Replace only needs to add entries.
currentRPItems := new(StaticRPItems)
if err := p.client.GetConfig(ctx, currentRPItems); err == nil && !reflect.DeepEqual(rpItems, currentRPItems) {
if err := p.client.Delete(ctx, new(StaticRPItems)); err != nil {
return err
}
}
conf = append(conf, rpItems)
} else {
del = append(del, rpItems)
Expand Down
Loading