I am trying to annotate below “must” statement under leaf “port-name” in container port-reference
augment “/if:interfaces/if:interface” {
when “(if:type = ‘ianaift:ethernetCsmacd’) or
(if:type = ‘ianaift:l2vlan’)” {
description “Applies to ethernetCsmacd and l2vlan interfaces”;
}
description
“Augment the interface model with parameters for all
both ethernetCsmacd and l2vlan interfaces.”;
leaf mac-address {
type yang:mac-address;
description
"The MAC address of the interface.";
}
container port-reference {
description
"a port reference used by other O-RAN modules";
leaf port-name {
type leafref {
path '/hw:hardware/hw:component/hw:name';
}
**must "derived-from-or-self(deref(current())/../hw:class, 'ianahw:port')";**
}
}
]
Using the below annotate model
o-ran-interfaces-ann.yang
module o-ran-interfaces-ann {
namespace “urn:o-ran-interfaces-ann:1.0”;
prefix ointa;
import tailf-common {
prefix tailf;
}
import o-ran-interfaces {
prefix oint;
}
import iana-hardware {
prefix “ianahw”;
}
import ietf-interfaces {
prefix “if”;
}
import ietf-hardware {
prefix “hw”;
}
description
“Annotate model for o-ran-interfaces adds the callpoints necessary for using this module with ConfD.”;
tailf:annotate-module 'oint'{
tailf:annotate-statement augment[7]{
tailf:annotate-statement container[name=‘port-reference’]{
tailf:annotate-statement leaf[name=‘port-name’] {
tailf:annotate-statement must {
tailf:dependency 'hw:hardware/hw:component/hw:class';
} } } } }
}
now facing below error when trying to build fxs using below command
/root/confd/bin/confdc --fail-on-warnings -a o-ran-interfaces-ann.yang -c o-ran-interfaces.yang -o o-ran-interfaces.fxs --yangpath …/…/imported_models/ --verbose
Generating .fxs file “o-ran-interfaces.fxs”
o-ran-interfaces.yang:399: error: The ‘must’ expression should have a tailf:dependency. If is doesn’t, it will be checked for every commit.
when I add the tailf:dependency into the main yang itself, it is working fine.
what am i missing?