I’ve added a “refine” and “must” when “uses” refers to a group. An example of how it’s being used is as follows :
uses bird-config {
refine feathers-count {
must '(. = 3000)' {
error-message "Invalid number of feathers";
}
}
}
Where the grouping "bird-config" is defined as:
grouping bird-config {
description
"Per bird configuration data.";
leaf bird-name {
type species:birds;
description
"[adapted from IETF BIRD model RFC 0000]
The bird name.";
}
leaf feathers-count {
type uint8 {
range "0..3000";
}
mandatory true;
description
"[adapted from IETF BIRD model RFC 0000]
The number of feathers.";
}
}
Why is error not being thrown with this simple refine-must statement when I input numbers that aren’t 3000 in feathers-count?
I've tried double-quoting feathers-count in refine and double-quoting the must conditional statement instead of single quotes. I expected that when I run a configuration with an input number that isn't 3000 for feathers-count, an error should be thrown and the configuration should not apply, but what resulted was the configuration being seamlessly applied.