summaryrefslogtreecommitdiff
path: root/scripts/build-command-templates
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build-command-templates')
-rwxr-xr-xscripts/build-command-templates11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/build-command-templates b/scripts/build-command-templates
index d6585b0cc..452c420eb 100755
--- a/scripts/build-command-templates
+++ b/scripts/build-command-templates
@@ -274,13 +274,14 @@ def process_node(n, tmpl_dir):
raise ValueError("<valueless/> is only allowed in <leafNode>")
nodedef_path = os.path.join(make_path(my_tmpl_dir), "node.def")
- if not os.path.exists(nodedef_path):
+
+ # Only create the "node.def" file if it exists but is empty, or if it does
+ # not exist at all. An empty node.def file could be generated by XML paths
+ # that derive from one another bot having a common base structure like
+ # "protocols static"
+ if not os.path.exists(nodedef_path) or os.path.getsize(nodedef_path) == 0:
with open(nodedef_path, "w") as f:
f.write(make_node_def(props))
- else:
- # Something has already generated that file
- pass
-
if node_type == "node":
inner_nodes = children.iterfind("*")