summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-06-06 10:51:33 -0500
committerGitHub <noreply@github.com>2024-06-06 10:51:33 -0500
commite3a04ea99108a2c4fbe1f95e93621fbf81bf750d (patch)
tree6072ecb5f2f6ab1629a0141e5d7df453fed241b2 /scripts
parent7a0d80e11326622021e1b282df0d3aac0b233ba1 (diff)
parent61f8250184e927de9ab6bddc207b917bef7da42b (diff)
downloadvyos-1x-e3a04ea99108a2c4fbe1f95e93621fbf81bf750d.tar.gz
vyos-1x-e3a04ea99108a2c4fbe1f95e93621fbf81bf750d.zip
Merge pull request #3589 from natali-rs1985/T6423-current
xml: T6423: enforce priority on nodes having an owner
Diffstat (limited to 'scripts')
-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)