If a when expression is ending with single quotes ' , then the .When().Expression() method is not returning the complete when condition including the single qutoes.
eg: If the when expression is "class != 'wheel'", then the Expression() method just returns "class != 'wheel" - the single quotes after wheel is missing.
Yang file used to test:
module basic_when {
namespace "urn:params:basic_when";
prefix basic_when;
container root-container {
leaf leaf-root {
type enumeration {
enum "one";
enum "two";
enum "three";
}
}
container container-condition {
leaf leaf-nested {
type boolean;
}
}
leaf leaf-root-when {
when "../leaf-root = 'one'";
type int8;
}
leaf-list leaf-list-root-when {
when "../leaf-root = 'two'";
type int8;
}
container container-leafs {
leaf leaf-nested-when {
when "../../container-condition/leaf-nested = 'true'";
type int8;
}
leaf-list leaf-list-nested-when {
when "../../container-condition/leaf-nested = 'false'";
type int8;
}
}
container container-when {
when "../leaf-root = 'two'";
leaf leaf-A {
type string;
}
}
list list-when {
when "../leaf-root = 'three'";
leaf leaf-B {
type string;
}
}
}
}
If a when expression is ending with single quotes ' , then the.When().Expression() method is not returning the complete when condition including the single qutoes.
eg: If the when expression is "class != 'wheel'", then the Expression() method just returns "class != 'wheel" - the single quotes after wheel is missing.
Yang file used to test:
The same issue exists for must expression also.