summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2025-12-18 14:29:59 -0600
committerJohn Estabrook <jestabro@vyos.io>2025-12-19 09:45:00 -0600
commit3e2eb92c1c931220cc43eccdb52889435d208ec4 (patch)
tree8f0ba50de058660f99f20bddca1945b1e098eb8e
parent008fefbe2c7dc1681d968ac0582087cd429d6796 (diff)
downloadvyos1x-config-3e2eb92c1c931220cc43eccdb52889435d208ec4.tar.gz
vyos1x-config-3e2eb92c1c931220cc43eccdb52889435d208ec4.zip
T8109: fix show command on leaf path
Leaf node name/value was not included in output.
-rw-r--r--src/config_diff.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/config_diff.ml b/src/config_diff.ml
index b69440d..25c393f 100644
--- a/src/config_diff.ml
+++ b/src/config_diff.ml
@@ -699,7 +699,13 @@ let diff_show rt path left right =
else
let (left, right) =
if not (Util.is_empty path) then
- (Config_tree.get_subtree left path, Config_tree.get_subtree right path)
+ let with_node =
+ match Reference_tree.get_path_type rt path with
+ | `Leaf -> true
+ | _ -> false
+ in
+ (Config_tree.get_subtree ~with_node left path,
+ Config_tree.get_subtree ~with_node right path)
else (left, right)
in
let config_show = make_diff_show left right path in