When I set a boolean leaf value to its default value, I hit the MOP_MODIFIED callback. How to avoid this?
Best regards.
When I set a boolean leaf value to its default value, I hit the MOP_MODIFIED callback. How to avoid this?
Best regards.
Hello,
by set
do you mean e.g. setting value in CLI or programmatically (e.g. with maapi_set_elem
function)?
Did the leaf already had default value or did it have some other value, before setting to default.
MOP_MODIFIED
should not be received for leaf
, but for a list
informing that something inside list was updated.
A descendant of the list entry given by kp has been modified.
In my schema i have a leaf
leaf enable {
type boolean;
default true;
}
From the CLI when I set this field to true again, I hit the MOP_VALUE_SET( apologies for the mistake above- It’s not MOP_MODIFIED) When by default the value for enable leaf is true, I was expecting “% No modifications to commit” when I try to set the value to default value again from CLI.
Best regards.
Thanks for clarification.
If you set some value (even same as default
value) to leaf, it is not considered default, unless you specify this in confd.conf
, option /confdConfig/defaultHandlingMode
.
See ConfD User Guide, section confd.conf
for clarification.
You may try to add to your confd.conf
following line:
<defaultHandlingMode>trim</defaultHandlingMode>
which would lead to behavior you expect.
Thanks a lot… I shall try it