Skip to content

Commit

Permalink
Update goyang dependency to v0.2.1 (#463)
Browse files Browse the repository at this point in the history
* Upgrade goyang to version @0.2.1

This update makes ygot compatible with the new backwards-incompatible
min/max-elements changes to goyang.
  • Loading branch information
wenovus authored Oct 15, 2020
1 parent 50b44fc commit 28239b4
Show file tree
Hide file tree
Showing 29 changed files with 109,505 additions and 107,916 deletions.
69,710 changes: 35,111 additions & 34,599 deletions exampleoc/oc.go

Large diffs are not rendered by default.

144 changes: 104 additions & 40 deletions exampleoc/ocpath.go

Large diffs are not rendered by default.

69,624 changes: 35,068 additions & 34,556 deletions exampleoc/opstateoc/oc.go

Large diffs are not rendered by default.

69,693 changes: 35,097 additions & 34,596 deletions exampleoc/wrapperunionoc/oc.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions experimental/ygotutils/getnode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestGetNodeSimpleKeyedList(t *testing.T) {
"simple-key-list": &yang.Entry{
Name: "simple-key-list",
Kind: yang.DirectoryEntry,
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
Key: "key1",
Config: yang.TSTrue,
Dir: map[string]*yang.Entry{
Expand Down Expand Up @@ -341,7 +341,7 @@ func TestGetNodeStructKeyedList(t *testing.T) {
"struct-key-list": &yang.Entry{
Name: "struct-key-list",
Kind: yang.DirectoryEntry,
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
Key: "key1 key2 key3",
Config: yang.TSTrue,
Dir: map[string]*yang.Entry{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/google/go-cmp v0.4.1
github.com/kylelemons/godebug v1.1.0
github.com/openconfig/gnmi v0.0.0-20200508230933-d19cebf5e7be
github.com/openconfig/goyang v0.0.0-20200803193518-78bac27bdff1
github.com/openconfig/goyang v0.2.1
github.com/pmezard/go-difflib v1.0.0
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 // indirect
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ github.com/openconfig/gnmi v0.0.0-20200414194230-1597cc0f2600/go.mod h1:M/EcuapN
github.com/openconfig/gnmi v0.0.0-20200508230933-d19cebf5e7be h1:VEK8utxoyZu/hkpjLxvuBmK5yW3NmBo/v/Wu5VQAJVs=
github.com/openconfig/gnmi v0.0.0-20200508230933-d19cebf5e7be/go.mod h1:M/EcuapNQgvzxo1DDXHK4tx3QpYM/uG4l591v33jG2A=
github.com/openconfig/goyang v0.0.0-20200115183954-d0a48929f0ea/go.mod h1:dhXaV0JgHJzdrHi2l+w0fZrwArtXL7jEFoiqLEdmkvU=
github.com/openconfig/goyang v0.0.0-20200803193518-78bac27bdff1 h1:qWqJWq75QvJcn/RJJraNgBOzgzqL7FXgeqChxOBH6MU=
github.com/openconfig/goyang v0.0.0-20200803193518-78bac27bdff1/go.mod h1:vX61x01Q46AzbZUzG617vWqh/cB+aisc+RrNkXRd3W8=
github.com/openconfig/goyang v0.2.1 h1:TaADsLGzULGQL8xTmvLjmXqZ/J1F73dMzURDqrv9cLs=
github.com/openconfig/goyang v0.2.1/go.mod h1:vX61x01Q46AzbZUzG617vWqh/cB+aisc+RrNkXRd3W8=
github.com/openconfig/ygot v0.6.0/go.mod h1:o30svNf7O0xK+R35tlx95odkDmZWS9JyWWQSmIhqwAs=
github.com/pborman/getopt v0.0.0-20190409184431-ee0cd42419d3 h1:YtFkrqsMEj7YqpIhRteVxJxCeC3jJBieuLr0d4C4rSA=
github.com/pborman/getopt v0.0.0-20190409184431-ee0cd42419d3/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o=
Expand Down
7,409 changes: 3,728 additions & 3,681 deletions uexampleoc/oc.go

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions util/debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func TestSchemaTypeStr(t *testing.T) {
schema: &yang.Entry{
Kind: yang.DirectoryEntry,
Dir: map[string]*yang.Entry{},
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
},
want: "list",
},
Expand All @@ -155,14 +155,14 @@ func TestSchemaTypeStr(t *testing.T) {
{
schema: &yang.Entry{
Kind: yang.LeafEntry,
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
},
want: "leaf-list",
},
{
schema: &yang.Entry{
Kind: yang.DirectoryEntry,
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
},
want: "other",
},
Expand Down Expand Up @@ -210,7 +210,7 @@ func TestYangTypeToDebugString(t *testing.T) {
func TestSchemaTreeString(t *testing.T) {
schema := &yang.Entry{
Kind: yang.DirectoryEntry,
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
Key: "key_field_name",
Config: yang.TSTrue,
Dir: map[string]*yang.Entry{
Expand Down Expand Up @@ -238,7 +238,7 @@ func TestDataSchemaTreesString(t *testing.T) {
"key-list": {
Name: "key-list",
Kind: yang.DirectoryEntry,
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
Key: "key",
Config: yang.TSTrue,
Dir: map[string]*yang.Entry{
Expand Down
6 changes: 3 additions & 3 deletions util/reflect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ func TestGetNodesSimpleKeyedList(t *testing.T) {
"simple-key-list": {
Name: "simple-key-list",
Kind: yang.DirectoryEntry,
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
Key: "key1",
Config: yang.TSTrue,
Dir: map[string]*yang.Entry{
Expand Down Expand Up @@ -1595,7 +1595,7 @@ func TestGetNodesSimpleKeyedList(t *testing.T) {
"simple-key-list": {
Name: "simple-key-list",
Kind: yang.DirectoryEntry,
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
Key: "enum-key",
Config: yang.TSTrue,
Dir: map[string]*yang.Entry{
Expand Down Expand Up @@ -1930,7 +1930,7 @@ func TestGetNodesStructKeyedList(t *testing.T) {
"struct-key-list": {
Name: "struct-key-list",
Kind: yang.DirectoryEntry,
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
Key: "key1 key2",
Config: yang.TSTrue,
Dir: map[string]*yang.Entry{
Expand Down
18 changes: 9 additions & 9 deletions util/yang_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ func TestIsOrNotKeyedList(t *testing.T) {
desc: "keyed list",
schema: &yang.Entry{
Kind: yang.DirectoryEntry,
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
Key: "key",
Dir: map[string]*yang.Entry{},
},
Expand All @@ -972,7 +972,7 @@ func TestIsOrNotKeyedList(t *testing.T) {
desc: "unkeyed list",
schema: &yang.Entry{
Kind: yang.DirectoryEntry,
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
Dir: map[string]*yang.Entry{},
},
wantKeyedList: false,
Expand Down Expand Up @@ -1727,12 +1727,12 @@ func TestValidateLeafRefData(t *testing.T) {
Name: "leaf-list",
Kind: yang.LeafEntry,
Type: &yang.YangType{Kind: yang.Yint32},
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
},
"list": {
Name: "list",
Kind: yang.DirectoryEntry,
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
Key: "key",
Dir: map[string]*yang.Entry{
"key": {
Expand Down Expand Up @@ -1813,7 +1813,7 @@ func TestValidateLeafRefData(t *testing.T) {
Kind: yang.Yleafref,
Path: "../../int32",
},
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
},
"absolute-to-int32": {
Name: "absolute-to-int32",
Expand All @@ -1822,7 +1822,7 @@ func TestValidateLeafRefData(t *testing.T) {
Kind: yang.Yleafref,
Path: "/int32",
},
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
},
"recursive": {
Name: "recursive",
Expand All @@ -1831,7 +1831,7 @@ func TestValidateLeafRefData(t *testing.T) {
Kind: yang.Yleafref,
Path: "../leaf-list-with-leafref",
},
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
},
"bad-path": {
Name: "bad-path",
Expand All @@ -1840,15 +1840,15 @@ func TestValidateLeafRefData(t *testing.T) {
Kind: yang.Yleafref,
Path: "../../missing",
},
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
},
"missing-path": {
Name: "missing-path",
Kind: yang.LeafEntry,
Type: &yang.YangType{
Kind: yang.Yleafref,
},
ListAttr: &yang.ListAttr{MinElements: &yang.Value{Name: "0"}},
ListAttr: yang.NewDefaultListAttr(),
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@
]
},
"ListAttr": {
"MinElements": null,
"MaxElements": null,
"MinElements": 0,
"MaxElements": 18446744073709551615,
"OrderedBy": null
}
},
Expand Down Expand Up @@ -311,8 +311,8 @@
},
"Key": "peer-address",
"ListAttr": {
"MinElements": null,
"MaxElements": null,
"MinElements": 0,
"MaxElements": 18446744073709551615,
"OrderedBy": null
},
"Annotation": {
Expand Down
Loading

0 comments on commit 28239b4

Please sign in to comment.