summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2021-01-15 13:15:08 +0700
committerGitHub <noreply@github.com>2021-01-15 13:15:08 +0700
commitb19a128521e576880d0b6285932ac0406d45627c (patch)
treee6fcf203fb97533820dae6332d1cde64e8e2387e
parent3ece840792011fcca00617e42b049e1414ebb1d6 (diff)
downloadvyos-1x-b19a128521e576880d0b6285932ac0406d45627c.tar.gz
vyos-1x-b19a128521e576880d0b6285932ac0406d45627c.zip
Revert "T3165: use a separate file for "base" CLI nodes."
-rw-r--r--Makefile3
-rw-r--r--interface-definitions/base/base.xml23
-rwxr-xr-xscripts/build-command-op-templates1
-rwxr-xr-xscripts/build-command-templates15
4 files changed, 4 insertions, 38 deletions
diff --git a/Makefile b/Makefile
index 0fd23f713..00d7b5e21 100644
--- a/Makefile
+++ b/Makefile
@@ -33,9 +33,6 @@ op_xml_obj = $(op_xml_src:.xml.in=.xml)
interface_definitions: $(config_xml_obj)
mkdir -p $(TMPL_DIR)
- # Build "base" templates (service, interfaces, other high-level nodes)
- $(CURDIR)/scripts/build-command-templates $(CURDIR)/interface-definitions/base/base.xml $(CURDIR)/schema/interface_definition.rng $(TMPL_DIR)
-
find $(BUILD_DIR)/interface-definitions -type f -name "*.xml" | xargs -I {} $(CURDIR)/scripts/build-command-templates {} $(CURDIR)/schema/interface_definition.rng $(TMPL_DIR) || exit 1
# XXX: delete top level node.def's that now live in other packages
diff --git a/interface-definitions/base/base.xml b/interface-definitions/base/base.xml
deleted file mode 100644
index 919478d45..000000000
--- a/interface-definitions/base/base.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<interfaceDefinition>
- <node name="interfaces">
- <properties>
- <help>Network interfaces</help>
- </properties>
- </node>
- <node name="high-availability">
- <properties>
- <help>High availability mechanisms</help>
- </properties>
- </node>
- <node name="nat">
- <properties>
- <help>Network address translation</help>
- </properties>
- </node>
- <node name="service">
- <properties>
- <help>Network and system services</help>
- </properties>
- </node>
-</interfaceDefinition>
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 <maintainers@vyos.net>
+# Copyright (C) 2017 VyOS maintainers <maintainers@vyos.net>
#
# 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 <node> 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 <tagNode> 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: