I try to restrict delete the port untill subport is exist. for that i tried below code,
Its not pointing properly. I’m not sure what i have missed.
container Port {
leaf portID {
type leafref {
path "/data:cardData/data:port/data:portID";
}
description "A unique port ID";
}
list subport {
key "subPortID";
uses subport:subPort;
}
}
grouping subPort {
description
"subport on the port";
leaf subPortID {
type string;
}
}
I have introduced below check to restrict delete port dependency,
grouping subPort {
description
"subport on the port";
leaf subPortID {
must "../portID" { <======= new code
error-message "client cannot delete, since its is dependent with subport"; <======= new code
} <======= new code
type string;
}
}