|
The config diff function produces both del(ete) and sub(tract) trees.
The delete tree contains the minimal path difference between compared
trees, for example, between the active and proposed configs; this is
the information needed to execute removal of a path. The subtract tree
contains the full paths in active that are not in proposed; this retains
necessary information in certain cases. In case all tag values of a tag
node are removed, the delete tree contains only the tag node itself,
however for proper script execution of a deleted tag node, one will need
the removed tag node values: restore this information from the subtract
tree.
|
|
In the intial implementation, the delete tree only kept the first node
of a path not present in the RHS of the comparison; this was done as a
convenience for generating 'trimmed' delete commands for the CLI.
However, this loses needed information, and breaks the symmetry of
results:
LHS, RHS -> del, inter, add
RHS, LHS -> add, inter, del
Keep full paths in delete tree and rename trees.del to trees.sub(-tract).
A separate function 'trim_tree' will be provided to produce a
CLI-appopriate delete tree and commands.
|