summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
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: