Hi. I am create a container that dispatch set hook s to create interface in a branch of the thee. It work fine via cli. However it is called in wrong time when i use netconf with a full config, containing both interfaces and provision commands. If I remove one provision leaf, some interfaces should be removed(there is one provision deletion implemeted that do this right). However, If provision command comes first and interfaces next inside this full config, the deletion hook excludes the interfaces and the interfaces inside the xml recreate the interfaces wrongly. There is some way tô remove the interfaces of this candidate config, during the set hook? Seen like the xml containing the candidate is now affected during the hook, as it overwrite my configs. I simples can remove interfaces leafs using a hook in netconf. They always are recreate.
There are two types of hooks supported by ConfD, set hooks and transaction hooks. The main difference between the two is when they are invoked. Set hooks are invoked directly as an object is modified, and transaction hooks are invoked in the two-phase commit phase. The ConfD transaction engine receives all the original write operations from one of the north bound agents. Once all write operations have been received, i.e. when a user for example types “commit” in the CLI, the transaction engine invokes the relevant transaction hooks. You can refer to Chapter 10.6 of the ConfD User Guide for more information on Hooks.
Not knowing full details of your implementation, it is difficult to comment on what may have gone wrong. It is also not clear the difference between how you are making the changes in CLI versus NETCONF.
To help with debugging your issue, this can best be addressed by our support team. Please file a RT ticket through your account.
I am using netconf to load a complete config. Confd so get this and dispatch set hooks. This one may create/delete other information inside other branch in the three. In the specific case of delete operation, it is called. However, if it this comple config xml (with is received by netconf) contains interface information(the other branch in the three), I am able to delete the interfaces, but they are recreated as soon as I finish the hook.
If I issue the command throught CLI, or even send a simple via netconf(not a full config database), it work well.
There is some way of changing the received XML config inside the set hook? OR should I use the transaction hook(that is called in the commit, I know)?
If I am understanding your use case right, it does look like you should be using transaction hook instead. As transaction hooks are invoked in the two-phase commit phase and nothing else can undo that change within that transaction.