Skip to content

Commit

Permalink
Fix setting origin for root path
Browse files Browse the repository at this point in the history
  • Loading branch information
DanG100 committed Dec 21, 2022
1 parent 66e9876 commit 43c0249
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/testutil/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func GNMIPath(t testing.TB, s string) *gpb.Path {
t.Fatal(err)
}
// TODO: remove when fixed https://github.com/openconfig/ygot/issues/615
if len(p.Elem) > 0 && p.Elem[0].Name != "meta" {
if p.Origin == "" && (len(p.Elem) == 0 || p.Elem[0].Name != "meta") {
p.Origin = "openconfig"
}
return p
Expand Down
2 changes: 1 addition & 1 deletion ygnmi/gnmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ func resolvePath(q PathStruct) (*gpb.Path, error) {
}

// TODO: remove when fixed https://github.com/openconfig/ygot/issues/615
if len(path.Elem) > 0 && path.Elem[0].Name != "meta" && path.Origin == "" {
if path.Origin == "" && (len(path.Elem) == 0 || path.Elem[0].Name != "meta") {
path.Origin = "openconfig"
}

Expand Down

0 comments on commit 43c0249

Please sign in to comment.