summaryrefslogtreecommitdiff
path: root/scripts/build-command-templates
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-06-09 17:01:23 +0200
committerGitHub <noreply@github.com>2024-06-09 17:01:23 +0200
commit23d02fae78b05ee3cf08bb8e8023d6c4c339789e (patch)
tree612afa46e544dcb03948011fa2c72edc89e988b2 /scripts/build-command-templates
parent264037d4cc3d4b2222da4ebc51258d2919f76840 (diff)
parent6ec4be553be88da4540554c6f36ab051c565dfcf (diff)
downloadvyos-1x-23d02fae78b05ee3cf08bb8e8023d6c4c339789e.tar.gz
vyos-1x-23d02fae78b05ee3cf08bb8e8023d6c4c339789e.zip
Merge pull request #3603 from vyos/mergify/bp/sagitta/pr-3589
xml: T6423: enforce priority on nodes having an owner (backport #3589)
Diffstat (limited to 'scripts/build-command-templates')
-rwxr-xr-xscripts/build-command-templates12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/build-command-templates b/scripts/build-command-templates
index 2e7f8b994..36929abb2 100755
--- a/scripts/build-command-templates
+++ b/scripts/build-command-templates
@@ -287,6 +287,12 @@ def process_node(n, tmpl_dir):
props = get_properties(props_elem, n.find("defaultValue"))
if owner:
props["owner"] = owner
+ # <priority> tag is mandatory if the parent node has an owner
+ if "priority" not in props:
+ raise ValueError(
+ f"<priority> tag should be set for the node <{name}> path '{' '.join(my_tmpl_dir[1:])}'"
+ )
+
# Type should not be set for non-tag, non-leaf nodes
# For non-valueless leaf nodes, set the type to txt: to make them have some type,
# actual value validation is handled by constraints translated to syntax:expression:
@@ -335,4 +341,8 @@ nodes = root.iterfind("*")
for n in nodes:
if n.tag == "syntaxVersion":
continue
- process_node(n, [output_dir])
+ try:
+ process_node(n, [output_dir])
+ except ValueError as e:
+ print(e)
+ sys.exit(1)