Skip to content

Commit

Permalink
Merge pull request #79 from openconfig/origin-fix2
Browse files Browse the repository at this point in the history
Fix setting origin for root path
  • Loading branch information
DanG100 authored Dec 21, 2022
2 parents 66e9876 + 43c0249 commit 897697d
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 897697d

Please sign in to comment.