Closed andreasjakobik closed 4 years ago
Hi ,
Recently we have another user have the same problem. and this time the leafref leaf is inside the grouping, please consider this use case as well.
Thanks.
Hello,
Below is a distilled test model that expose the problem with leafref path referencing a node in another grouping.
Thanks, Andreas
grouping gy-failure-profile-type {
leaf name {
type string;
}
}
grouping gy-profile-type {
leaf name {
type string;
}
leaf failure-profile {
type leafref {
// Relative path is not resolved!
path "../../gy-failure-profile/name";
// However absolute path works fine:
// path "/epg/pgw/credit-control/gy-failure-profile/name";
}
}
}
grouping pgw-type {
container credit-control {
list gy-failure-profile {
key "name";
uses gy-failure-profile-type;
}
list gy-profile {
key "name";
uses gy-profile-type;
}
}
}
container epg {
container pgw {
uses pgw-type;
}
}
Hi Miro,
we have another use case that grouping with relative leafref path does not work. generally two groupings used by container, inside one grouping use leafref reference another grouping.
Thanks. //Rim
container packet-detection {
description
"Configuration for packet detection";
uses applist;
uses filterlist;
}
grouping applist {
container application-list {
description
"Configuration for packet inspection";
config false;
list application {
choice app-matching-conditions-start-menu {
leaf filter {
description
"Matching Condition Filter identifier to match";
type leafref {
// this relative xpath works fine
path "../../../filter-list/filter/name";
}
}
list and {
leaf-list filter {
description
"Matching Condition Filter identifier to match";
type leafref {
// this releative xpath can't resolve
path "../../../../filter-list/filter/name";
}
}
}
}
}
}
}
grouping filterlist {
container filter-list {
description
"Configuration for packet inspection";
list filter {
key "name";
leaf name {
description
"Filter identifier";
type string;
mandatory true;
}
}
}
}
Hi,
In the above test model (beginning with container packet-detection
) it seems the choice statement (choice app-matching-conditions-start-menu
) is causing the leafref path error. If I remove the choice statement, the model works fine.
Thanks,
Andreas
Hi,
Consider the below yang definition. Relative paths in leafref typed leafs inside an action input / output statement are not resolved correctly. An extra level has to be inserted into the path, but that is against yang spec, and definitely not aligned with how confd tool validates.
Any hints how to correct this issue is much appreciated.
Thanks, Andreas
`container c1 {