From b19a128521e576880d0b6285932ac0406d45627c Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 15 Jan 2021 13:15:08 +0700 Subject: Revert "T3165: use a separate file for "base" CLI nodes." --- scripts/build-command-op-templates | 1 - scripts/build-command-templates | 15 ++++----------- 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/build-command-op-templates b/scripts/build-command-op-templates index 54cc07794..c60b32a1e 100755 --- a/scripts/build-command-op-templates +++ b/scripts/build-command-op-templates @@ -193,7 +193,6 @@ def process_node(n, tmpl_dir): f.write('help: {0}\n'.format(props['help'])) else: # Something has already generated this file - print("Warning: refusing to overwrite already existing file {}".format(nodedef_path)) pass # Create the inner node.tag part diff --git a/scripts/build-command-templates b/scripts/build-command-templates index f09941e68..d6585b0cc 100755 --- a/scripts/build-command-templates +++ b/scripts/build-command-templates @@ -3,7 +3,7 @@ # build-command-template: converts new style command definitions in XML # to the old style (bunch of dirs and node.def's) command templates # -# Copyright (C) 2017,2021 VyOS maintainers +# Copyright (C) 2017 VyOS maintainers # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -279,26 +279,19 @@ def process_node(n, tmpl_dir): f.write(make_node_def(props)) else: # Something has already generated that file - print("Warning: refusing to overwrite already existing file {}".format(nodedef_path)) pass - if (node_type == "node") and (children is None): - print("Warning: non-leaf, non-tag without children may be incomplete ({})".format(nodedef_path)) - pass - elif node_type == "node": + if node_type == "node": inner_nodes = children.iterfind("*") for inner_n in inner_nodes: process_node(inner_n, my_tmpl_dir) - elif node_type == "tagNode": - if children is None: - raise ValueError("A without children is not allowed") - - inner_nodes = children.iterfind("*") + if node_type == "tagNode": my_tmpl_dir.append("node.tag") if debug: print("Created path for the tagNode:", end="") os.makedirs(make_path(my_tmpl_dir), exist_ok=True) + inner_nodes = children.iterfind("*") for inner_n in inner_nodes: process_node(inner_n, my_tmpl_dir) else: -- cgit v1.2.3