summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-08-22 14:56:28 -0500
committerJohn Estabrook <jestabro@vyos.io>2023-08-22 18:20:37 -0500
commit3509491dd94cc371f5b0a4166274532acc5e6764 (patch)
treecc19cc4a741fb3b2086773b938bf092d8d79aa32
parent9f842e6dcf83095f463fe7b26c575bc85f62baca (diff)
downloadvyos1x-config-3509491dd94cc371f5b0a4166274532acc5e6764.tar.gz
vyos1x-config-3509491dd94cc371f5b0a4166274532acc5e6764.zip
T5500: render_tag_node_child does not need to consider values
Configtree allows for a tag node child to have values, however it is not possible to define such an object in the XML interface-definitions, hence that case can be ignored in render_tag_node_child.
-rw-r--r--src/config_tree.ml14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/config_tree.ml b/src/config_tree.ml
index b993836..531cae8 100644
--- a/src/config_tree.ml
+++ b/src/config_tree.ml
@@ -205,18 +205,10 @@ struct
let name = Vytree.name_of_node node in
let data = Vytree.data_of_node node in
let comment = render_comment indent_str data.comment in
- let values = render_values ~ord_val:ord_val indent_str name data.values in
let children = Vytree.children_of_node node in
- match children with
- (* This produces too much whitespace due to indent_str from values,
- but the issue is cosmetic *)
- | [] -> Printf.sprintf "%s%s%s %s" comment indent_str parent values
- | _ ->
- (* Exploiting the fact that immediate children of tag nodes are
- never themselves tag nodes *)
- let inner = List.map (render_node ~ord_val:ord_val indent (level + 1)) children in
- let inner = String.concat "" inner in
- Printf.sprintf "%s%s%s %s {\n%s%s}\n" comment indent_str parent name inner indent_str
+ let inner = List.map (render_node ~ord_val:ord_val indent (level + 1)) children in
+ let inner = String.concat "" inner in
+ Printf.sprintf "%s%s%s %s {\n%s%s}\n" comment indent_str parent name inner indent_str
let render_config ?(ord_val=false) node =
let children = Vytree.children_of_node node in