Well, that is a different issue with the same
when statement - strictly speaking, that issue doesn’t make the
when expression invalid though, it “just” means (if the description of the issue is correct, I haven’t checked) that the
oc-if:state/oc-if:type = 'oc-ift:IF_AGGREGATE' part of the expression will always evaluate to
when statement like
when "/foo = 'bar'" is perfectly valid even if
/foo is an integer leaf, in fact even if there is no
/foo at all in the schema (in both cases the expression will always evaluate to
false). confdc will (in most cases) produce a warning if the expression references a node that doesn’t exist in the schema, but not if a comparison uses a value that is “impossible” for the leaf.
Actually, looking closer, I see that the “the node is config, but refers to a non-config node” messages that you reported originally are also warnings, so presumably you are compiling with
--fail-on-warnings since you get them as errors. This means that you can suppress them with this option to confdc (from the man page):
Do not report the warning ErrorCode, even if --fail-on-warnings is
given. ErrorCode must be a warning.
confdc --list-errors will tell you that the relevant ErrorCode is YANG_ERR_XPATH_REF_BAD_CONFIG, i.e. you can use
to suppress the warnings. It’s not a good idea for modules that you will actually use though - if a
when expression (or
must expression or
leafref path) for config references state data, it means that the validity of the configuration depends on state, and thus that a validated and committed configuration can become invalid if some state data is changed (this is of course the reason for the requirements in the RFCs).