I want to create a list, which will link to another list.
a-module.yang
contains the main list:
module a-module {
namespace "http://tail-f.com/ns/example/linked-to";
prefix a;
list a-list {
key a-leaf;
leaf a-leaf {
type uint32;
}
leaf a-leaf2 {
type uint32;
mandatory true;
}
leaf a-leaf3 {
type uint32;
mandatory true;
}
}
}
–
b-module.yang
contains the list which link:
module b-module {
namespace "http://tail-f.com/ns/example/linked-from";
prefix b;
import tailf-common { prefix tailf; }
import a-module { prefix a; }
list b-list {
key b-leaf;
leaf b-leaf {
tailf:link "/a:a-list[a-leaf=current()../b-leaf]/a-leaf";
type uint32;
}
leaf b-leaf2 {
type uint32;
tailf:link "/a:a-list[a-leaf=current()../b-leaf]/a-leaf2";
mandatory true;
}
}
}
Now,
-
When I’m trying to commit to b-list I have a problem:
Aborted: ‘b-list b-leaf2’: destination instance ‘a-list a-leaf2’ does not exist
Which is true (I think), because it’s not yet created.
Is there a way to solve it? -
When I’m doing
show running-config b-list
I see no entries (I mean, not the entries I inserted in a-list)
Is this supposed to work? Should I change something?
Thanks
– edit –
I tried using leafref, but for some reason it says:
error: bad argument value "/a:a-list[a-leaf=current()../b-leaf]/a-leaf", should be of type path-arg