04-15-2020 10:45 AM
Hi all,
I'm new to yang and trying to define a MUST statement with or. However, when performing package reload, error message
'must' expression "contains(current(),'0400' or '0401')" failed. Can you use or as described in RFC6020? If yes, then please let me know if the must statement is wrongly defined.
Please see below.
list gwan-devices {
key device-name;
leaf device-name {
must "contains(current(),'0400' or '0401')";
type leafref {
path "/ncs:devices/ncs:device/ncs:name";
}
}
etc
Thank you for your help
Solved! Go to Solution.
04-15-2020 12:02 PM
I tried following configuration and that worked:
list gwan-devices {
key device-name;
leaf device-name {
type leafref {
path "/ncs:devices/ncs:device/ncs:name";
}
must "contains(current(),'0400') or
contains(current(),'0401') or
contains(current(),'2101')";
}
etc etc
04-15-2020 12:02 PM
I tried following configuration and that worked:
list gwan-devices {
key device-name;
leaf device-name {
type leafref {
path "/ncs:devices/ncs:device/ncs:name";
}
must "contains(current(),'0400') or
contains(current(),'0401') or
contains(current(),'2101')";
}
etc etc
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide