Validations and dependency question

A question from the “c_dependency” example on validation. In the example leaf_a has validation point vp1 registered against it. vp1 specifies a dependency on b_number.

The understanding is that vp1 will be called if leaf_a is configured or modified. vp1 will also be called if leaf_a is configured and b_number is modified.

vp1 will NOT be called if leaf_a is deleted.

Question is: will vp1 be called if b_number is deleted? In our tests, it does not look like it.

If this is expected behavior, how to achieve a call to vp1 (or some other validation point) when b_number is deleted?

The use case is leaf_a and b_number are dependent. Any one of them can exist but not both. Cannot do this via MUST statements since there are ID checks etc that need code to validate.


The simple reason that the validation point is not invoked is that leaf_a or number_b are not part of the new configuration.

You may want to read the section 9.6 on “Validation Points” in the ConfD User’s Guide, particularly the last part where there is a discussion of handling deletion. One common technique is to place the validation point at a higher level, for example on the container instead of the leaf.

Hi Greg,
In this scenario, either leaf_a or number_b will be present in the new config.

Moving up a level is not possible since these 2 nodes are in different sub-trees, it would have to be very close to root node. And that would be perf hit to get validation callbacks for all the other config changes that could be happening.

any other solutions?