summaryrefslogtreecommitdiff
path: root/src/config_diff.ml
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2025-12-19 19:46:42 -0600
committerJohn Estabrook <jestabro@vyos.io>2025-12-21 09:50:04 -0600
commitd58f34b51032be994346c64dc117b2421aa9cbdc (patch)
treeef059f0efbd23b767494c69fd9259383c77b29dd /src/config_diff.ml
parentdcc1a2bb0a6d6182bc758c630f842c2bec1020eb (diff)
downloadvyos1x-config-d58f34b51032be994346c64dc117b2421aa9cbdc.tar.gz
vyos1x-config-d58f34b51032be994346c64dc117b2421aa9cbdc.zip
T8113: fix logic error in show on tag nodes
Due to an unnecessary modification of the path argument, a deleted tag node value will be shown as a deleted tag node: the deletion is processed correctly, but the show annotation is incorrect.
Diffstat (limited to 'src/config_diff.ml')
-rw-r--r--src/config_diff.ml14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/config_diff.ml b/src/config_diff.ml
index 25c393f..54f6474 100644
--- a/src/config_diff.ml
+++ b/src/config_diff.ml
@@ -587,12 +587,7 @@ let config_diff (rt : Reference_tree.t) ?(recurse=true) (path : string list) (Di
in
match m with
| Added ->
- let node =
- if (Config_tree.is_tag_value[@alert "-exn"]) res.right path then
- (Vytree.get[@alert "-exn"]) res.right (Util.drop_last path)
- else
- (Vytree.get[@alert "-exn"]) res.right path
- in
+ let node = (Vytree.get[@alert "-exn"]) res.right path in
let level = get_level_at_path res.right path in
let rendered =
Config_tree.render_node indent level node
@@ -600,12 +595,7 @@ let config_diff (rt : Reference_tree.t) ?(recurse=true) (path : string list) (Di
let rev_diff = diff_str ^ annotate_rendered m rendered in
Diff_show {res with config_diff = rev_diff; open_blocks = rev_blocks;}
| Subtracted ->
- let node =
- if (Config_tree.is_tag_value[@alert "-exn"]) res.left path then
- (Vytree.get[@alert "-exn"]) res.left (Util.drop_last path)
- else
- (Vytree.get[@alert "-exn"]) res.left path
- in
+ let node = (Vytree.get[@alert "-exn"]) res.left path in
let level = get_level_at_path res.left path in
let rendered =
Config_tree.render_node indent level node