summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2025-08-07 18:35:06 -0500
committerJohn Estabrook <jestabro@vyos.io>2025-08-07 18:42:39 -0500
commit96cf89f5fdd415fec930f77e2f70446f999187e4 (patch)
tree15ffd2a7f92af5d1af6f054d6af5edaf45808878 /python
parent08feca7dbe5c14a468a041e212bcc4f6618edd96 (diff)
downloadvyos-1x-96cf89f5fdd415fec930f77e2f70446f999187e4.tar.gz
vyos-1x-96cf89f5fdd415fec930f77e2f70446f999187e4.zip
T7699: correctly update command/help fields for paths shared over files
Diffstat (limited to 'python')
-rwxr-xr-xpython/vyos/xml_ref/generate_op_cache.py31
1 files changed, 25 insertions, 6 deletions
diff --git a/python/vyos/xml_ref/generate_op_cache.py b/python/vyos/xml_ref/generate_op_cache.py
index fb48debad..83900c7c7 100755
--- a/python/vyos/xml_ref/generate_op_cache.py
+++ b/python/vyos/xml_ref/generate_op_cache.py
@@ -223,23 +223,42 @@ def insert_node(
new_node_data.standalone_help_text = standalone_help_text
new_node_data.standalone_command = standalone_command
new_node_data.path = path
+ new_node_data.files = [file]
value = {('__node_data', None): new_node_data}
key = (name, node_type)
cur_value = d.setdefault(key, value)
- # track the correct pointer reference:
- cur_node_data = cur_value[('__node_data', None)]
- cur_node_data.files.append(file)
-
- if parent and key not in parent.children:
- parent.children.append(key)
if CHECK_XML_CONSISTENCY:
out = node_data_difference(get_node_data(cur_value), get_node_data(value))
if out:
err_buf.write(out)
+ # track the correct pointer reference:
+ cur_node_data = cur_value[('__node_data', None)]
+
+ if file not in cur_node_data.files:
+ cur_node_data.files.append(file)
+
+ if not cur_node_data.comp_help and comp_help:
+ cur_node_data.comp_help = comp_help
+
+ if not cur_node_data.help_text and help_text:
+ cur_node_data.help_text = help_text
+
+ if not cur_node_data.command and command_text:
+ cur_node_data.command = command_text
+
+ if not cur_node_data.standalone_help_text and standalone_help_text:
+ cur_node_data.standalone_help_text = standalone_help_text
+
+ if not cur_node_data.standalone_command and standalone_command:
+ cur_node_data.standalone_command = standalone_command
+
+ if parent and key not in parent.children:
+ parent.children.append(key)
+
if children is not None:
inner_nodes = children.iterfind('*')
for inner_n in inner_nodes: