From 6ec4be553be88da4540554c6f36ab051c565dfcf Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Thu, 6 Jun 2024 13:55:25 +0300 Subject: xml: T6423: enforce priority on nodes having an owner (cherry picked from commit 61f8250184e927de9ab6bddc207b917bef7da42b) --- interface-definitions/load-balancing_reverse-proxy.xml.in | 1 + interface-definitions/load-balancing_wan.xml.in | 2 +- interface-definitions/protocols_static_arp.xml.in | 1 + interface-definitions/protocols_static_multicast.xml.in | 1 + interface-definitions/protocols_static_neighbor-proxy.xml.in | 1 + interface-definitions/service_config-sync.xml.in | 1 + interface-definitions/service_console-server.xml.in | 1 + interface-definitions/service_event-handler.xml.in | 1 + interface-definitions/service_monitoring_telegraf.xml.in | 2 +- interface-definitions/service_monitoring_zabbix-agent.xml.in | 1 + interface-definitions/service_sla.xml.in | 1 + interface-definitions/system_login_banner.xml.in | 1 + interface-definitions/system_proxy.xml.in | 1 + scripts/build-command-templates | 12 +++++++++++- 14 files changed, 24 insertions(+), 3 deletions(-) diff --git a/interface-definitions/load-balancing_reverse-proxy.xml.in b/interface-definitions/load-balancing_reverse-proxy.xml.in index ce757a5d6..1a432be6d 100644 --- a/interface-definitions/load-balancing_reverse-proxy.xml.in +++ b/interface-definitions/load-balancing_reverse-proxy.xml.in @@ -5,6 +5,7 @@ Configure reverse-proxy + 900 diff --git a/interface-definitions/load-balancing_wan.xml.in b/interface-definitions/load-balancing_wan.xml.in index e117fd1b2..310aa0343 100644 --- a/interface-definitions/load-balancing_wan.xml.in +++ b/interface-definitions/load-balancing_wan.xml.in @@ -3,12 +3,12 @@ Configure load-balancing - 900 Configure Wide Area Network (WAN) load-balancing + 900 diff --git a/interface-definitions/protocols_static_arp.xml.in b/interface-definitions/protocols_static_arp.xml.in index 05c69f1ed..0c5d6e4ed 100644 --- a/interface-definitions/protocols_static_arp.xml.in +++ b/interface-definitions/protocols_static_arp.xml.in @@ -7,6 +7,7 @@ Static ARP translation + 481 diff --git a/interface-definitions/protocols_static_multicast.xml.in b/interface-definitions/protocols_static_multicast.xml.in index c8e28ed35..caf95ed7c 100644 --- a/interface-definitions/protocols_static_multicast.xml.in +++ b/interface-definitions/protocols_static_multicast.xml.in @@ -7,6 +7,7 @@ Multicast static route + 481 diff --git a/interface-definitions/protocols_static_neighbor-proxy.xml.in b/interface-definitions/protocols_static_neighbor-proxy.xml.in index 1c8433a39..7347976f9 100644 --- a/interface-definitions/protocols_static_neighbor-proxy.xml.in +++ b/interface-definitions/protocols_static_neighbor-proxy.xml.in @@ -7,6 +7,7 @@ Neighbor proxy parameters + 481 diff --git a/interface-definitions/service_config-sync.xml.in b/interface-definitions/service_config-sync.xml.in index 648c14aee..af4e8ed51 100644 --- a/interface-definitions/service_config-sync.xml.in +++ b/interface-definitions/service_config-sync.xml.in @@ -5,6 +5,7 @@ Configuration synchronization + 10000 diff --git a/interface-definitions/service_console-server.xml.in b/interface-definitions/service_console-server.xml.in index fc6dbe954..68835dafd 100644 --- a/interface-definitions/service_console-server.xml.in +++ b/interface-definitions/service_console-server.xml.in @@ -5,6 +5,7 @@ Serial Console Server + 2 diff --git a/interface-definitions/service_event-handler.xml.in b/interface-definitions/service_event-handler.xml.in index 2cee4f595..41540816b 100644 --- a/interface-definitions/service_event-handler.xml.in +++ b/interface-definitions/service_event-handler.xml.in @@ -5,6 +5,7 @@ Service event handler + 2 diff --git a/interface-definitions/service_monitoring_telegraf.xml.in b/interface-definitions/service_monitoring_telegraf.xml.in index 4d694114a..2624023ea 100644 --- a/interface-definitions/service_monitoring_telegraf.xml.in +++ b/interface-definitions/service_monitoring_telegraf.xml.in @@ -5,12 +5,12 @@ Monitoring services - 1280 Telegraf metric collector + 1280 diff --git a/interface-definitions/service_monitoring_zabbix-agent.xml.in b/interface-definitions/service_monitoring_zabbix-agent.xml.in index 40f2df642..3754e9145 100644 --- a/interface-definitions/service_monitoring_zabbix-agent.xml.in +++ b/interface-definitions/service_monitoring_zabbix-agent.xml.in @@ -7,6 +7,7 @@ Zabbix-agent settings + 1280 diff --git a/interface-definitions/service_sla.xml.in b/interface-definitions/service_sla.xml.in index 0c4f8a591..2cd68195a 100644 --- a/interface-definitions/service_sla.xml.in +++ b/interface-definitions/service_sla.xml.in @@ -5,6 +5,7 @@ Service level agreement (SLA) + 2 diff --git a/interface-definitions/system_login_banner.xml.in b/interface-definitions/system_login_banner.xml.in index 211505ae4..c90e38c3c 100644 --- a/interface-definitions/system_login_banner.xml.in +++ b/interface-definitions/system_login_banner.xml.in @@ -11,6 +11,7 @@ System login banners + 410 diff --git a/interface-definitions/system_proxy.xml.in b/interface-definitions/system_proxy.xml.in index 214534dbb..5b0df5c70 100644 --- a/interface-definitions/system_proxy.xml.in +++ b/interface-definitions/system_proxy.xml.in @@ -5,6 +5,7 @@ Sets a proxy for system wide use + 100 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 + # tag is mandatory if the parent node has an owner + if "priority" not in props: + raise ValueError( + f" 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) -- cgit v1.2.3