Is it a best practice to test for the presence of a variable and include a tags="delete" in device templates, or just rely on NSO to remove leafs that were deployed with a service when there are no more refcounters to that leaf?
For example, lets say I create a leaf called "multicast-enable" and have the following in a device template as I only want this configuration deployed when "multicast-enable" is defined.
<pim when="{multicast-enable}">
</pim>
NSO is pretty reliable at removing this configuration section when the leaf is not defined, however I am sure there are some corner cases for which I am not aware. Is it a best practice to have a when="not" for every when defined to cover for these?
For example, should I also have an equivalent delete for every when??
<pim when="{not(multicast-eanble)}" tags="delete">
</pim>