Skip to content

Commit

Permalink
Package update and enhancements/fixes in YGOT, and Request Binder (so…
Browse files Browse the repository at this point in the history
…nic-net#12)

YGOT:-

To improve the performance of the Unmarshal and EmitJSON methods.
Caching the schema information to path instead of finding the schema for the path every time.
Disabled the validation of the response while marshaling the ygot object.
Added the debug check for the debug logs to get generated/printed only when the debug flag is enabled
Fixes in the Unmarshal method for the node leaf-list, and leaf contains union which has enum as one of its type.
Added changes in the Unmarshal method to throw an error if the request payload has the state information.
Request Binder:-

Added the method validateObjectType - to check and throw an error if the given request payload contains state information.
Added the changes not to validate the request payload if the model of the payload is sonic yang, since CVL validates the sonic yang model request
Package update:-

Updated the ygot package to the version v0.7.1
Updated the goyang package to the version v0.0.0-20200309174518-a00bece872fc
Updated the gnmi package to the version v0.0.0-20200307010808-e7106f7f5493
  • Loading branch information
mbalachandar authored Jun 29, 2020
1 parent 89d95a1 commit 9f2c938
Show file tree
Hide file tree
Showing 6 changed files with 656 additions and 330 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ require (
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c
github.com/openconfig/goyang v0.0.0-20190924211109-064f9690516f
github.com/openconfig/ygot v0.6.1-0.20190723223108-724a6b18a922
github.com/openconfig/gnmi v0.0.0-20200307010808-e7106f7f5493
github.com/openconfig/goyang v0.0.0-20200309174518-a00bece872fc
github.com/openconfig/ygot v0.7.1
github.com/pborman/getopt v0.0.0-20190409184431-ee0cd42419d3 // indirect
golang.org/x/text v0.3.0
google.golang.org/grpc v1.25.1 // indirect
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,18 @@ github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c h1:a380JP+B7xlMbEQOlha1buKhzBPXFqgFXplyWCEIGEY=
github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c/go.mod h1:t+O9It+LKzfOAhKTT5O0ehDix+MTqbtT0T9t+7zzOvc=
github.com/openconfig/gnmi v0.0.0-20200307010808-e7106f7f5493 h1:e/znXbq+Yiws97a4lJYlUeRw9OGxT2q27L4aMUb0GuM=
github.com/openconfig/gnmi v0.0.0-20200307010808-e7106f7f5493/go.mod h1:jMSUQIR4z9WTtM58/QBHbElXAwbUnomFdty1aund1uY=
github.com/openconfig/goyang v0.0.0-20190924211109-064f9690516f h1:BaekRUaWpfaRBP3mShDZaNi4+EHbdli7D6YXc/TP3lo=
github.com/openconfig/goyang v0.0.0-20190924211109-064f9690516f/go.mod h1:dhXaV0JgHJzdrHi2l+w0fZrwArtXL7jEFoiqLEdmkvU=
github.com/openconfig/goyang v0.0.0-20200115183954-d0a48929f0ea/go.mod h1:dhXaV0JgHJzdrHi2l+w0fZrwArtXL7jEFoiqLEdmkvU=
github.com/openconfig/goyang v0.0.0-20200309174518-a00bece872fc h1:W6XYKuH3mxF5WFhsSQOPPN9DRDba1xz9lbUbQR3uHkg=
github.com/openconfig/goyang v0.0.0-20200309174518-a00bece872fc/go.mod h1:dhXaV0JgHJzdrHi2l+w0fZrwArtXL7jEFoiqLEdmkvU=
github.com/openconfig/ygot v0.6.0/go.mod h1:o30svNf7O0xK+R35tlx95odkDmZWS9JyWWQSmIhqwAs=
github.com/openconfig/ygot v0.6.1-0.20190723223108-724a6b18a922 h1:zBLb75mrLMxabjsAhPk/2qxbht+BwHKFWBvRAB4Fd2U=
github.com/openconfig/ygot v0.6.1-0.20190723223108-724a6b18a922/go.mod h1:o30svNf7O0xK+R35tlx95odkDmZWS9JyWWQSmIhqwAs=
github.com/openconfig/ygot v0.7.1 h1:kqDRYQpowXTr7EhGwr2BBDKJzqs+H8aFYjffYQ8lBsw=
github.com/openconfig/ygot v0.7.1/go.mod h1:5MwNX6DMP1QMf2eQjW+aJN/KNslVqRJtbfSL3SO6Urk=
github.com/pborman/getopt v0.0.0-20190409184431-ee0cd42419d3 h1:YtFkrqsMEj7YqpIhRteVxJxCeC3jJBieuLr0d4C4rSA=
github.com/pborman/getopt v0.0.0-20190409184431-ee0cd42419d3/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
Expand Down
6 changes: 3 additions & 3 deletions patches/apply.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ function copy() {

set -x

copy github.com/openconfig/ygot v0.6.1-0.20190723223108-724a6b18a922 ygen generator
copy github.com/openconfig/ygot v0.7.1 ygen genutil generator

copy github.com/openconfig/goyang v0.0.0-20190924211109-064f9690516f .
copy github.com/openconfig/goyang v0.0.0-20200309174518-a00bece872fc .

copy github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c .
copy github.com/openconfig/gnmi v0.0.0-20200307010808-e7106f7f5493 .

# Apply patches

Expand Down
13 changes: 11 additions & 2 deletions patches/goyang/goyang.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ index 4d22c1e..805adb5 100644
progress.
diff --git a/annotate.go b/annotate.go
new file mode 100644
index 0000000..243c416
index 0000000..286a29c
--- /dev/null
+++ b/annotate.go
@@ -0,0 +1,395 @@
Expand Down Expand Up @@ -412,7 +412,7 @@ index 0000000..243c416
+}
+
diff --git a/pkg/yang/entry.go b/pkg/yang/entry.go
index ef658d6..f626dc9 100644
index ef658d6..cd3b046 100644
--- a/pkg/yang/entry.go
+++ b/pkg/yang/entry.go
@@ -80,6 +80,7 @@ type Entry struct {
Expand Down Expand Up @@ -450,6 +450,15 @@ index ef658d6..f626dc9 100644
return e
}

@@ -1007,7 +1014,7 @@ func (e *Entry) ApplyDeviate() []error {
}

if devSpec.Default != "" {
- deviatedNode.Default = ""
+ deviatedNode.Default = devSpec.Default
}

if devSpec.Mandatory != TSUnset {
@@ -1090,6 +1097,7 @@ func (e *Entry) FixChoice() {
}
ce.Parent = ne
Expand Down
Loading

0 comments on commit 9f2c938

Please sign in to comment.