Skip to content
Snippets Groups Projects
Commit dfe256e9 authored by Malte Bauch's avatar Malte Bauch
Browse files

Fix: failing commits while applying changes on the network element

If read-only fields are sent to the network element with a SetRequest an
error is thrown by the network element. This can be prevented by
filtering all the read-only fields with the help of
`ygot.PruneConfigFalse` - since they are not needed in a SetRequest.
parent e85711a7
No related branches found
No related tags found
1 merge request!401Change the current gosdn plugin implementation from Go's internal plugin system to hashicorp's go-plugins
Pipeline #135410 failed
...@@ -176,6 +176,10 @@ func (d *DeviceModel) Diff(original, modified []byte) (*gpb.Notification, error) ...@@ -176,6 +176,10 @@ func (d *DeviceModel) Diff(original, modified []byte) (*gpb.Notification, error)
return nil, err return nil, err
} }
//TODO: This should be changed to be optional
ygot.PruneConfigFalse(d.schema.RootSchema(), originalAsValidatedCopy)
ygot.PruneConfigFalse(d.schema.RootSchema(), modifiedAsValidatedCopy)
return ygot.Diff(originalAsValidatedCopy, modifiedAsValidatedCopy) return ygot.Diff(originalAsValidatedCopy, modifiedAsValidatedCopy)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment