ConfD User Community

Maapi_diff_iterate default value handling problem

Hi experts,

As part of the validation check, we use maapi_diff_iterate to see all the leaves that were changed. We met some strange behavior on the leaves with default value.


container simple {
  leaf a {
    type int64;
    default 42;
  leaf b {
    type int64;

First set /simple/b with some value, then delete the simple container on CLI. We get the below diff changes:
op=delete path= /simple/b
op=set path= /simple/a value= 42

But for the same container in other yang modules, we only get one operation:
op=delete path= /simple/b



Do you know the reasons behind this strange behavior?


Just for confirmation, do other yang modules have exactly the same container? With the same default value and container is not presence?

I understand first set of operations as deleting b and then setting to default value.
While second set of operation does not set default value.

If you show configuration with defaults, is default set in both cases?

Other yang modules have exactly the same container. These sets of operations are same, but on two yang modules which have the same container.

No, default handling is different in the two cases.

Do you know how the diff changes are generated by ConfD?

Unfortunately, I do not know ConfD internals.
I think you should try to isolate the behavior into small example - two small YANG files, small application with val. point, so you make sure it is issue on ConfD side. If yes, then it can be reported as an error.

Plus it might be worth checking latest accessible ConfD version and its changelog, just in case there were some default values related bugfixes that you might be hitting with older version…