summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2017-12-31 12:16:23 +0100
committerChristian Poessinger <christian@poessinger.com>2017-12-31 12:18:32 +0100
commit97e75dae0c4e75fa35fed1fb3407a429f7bfe537 (patch)
treecb0509dc71201ac4f513a546da74a265e3b7bff7
parent8826edfcbb60bc4372978b4a11d2300b07d5ac1c (diff)
downloadvyos-1x-97e75dae0c4e75fa35fed1fb3407a429f7bfe537.tar.gz
vyos-1x-97e75dae0c4e75fa35fed1fb3407a429f7bfe537.zip
Support setting optional 'type' node in command templates other than 'txt'
-rw-r--r--schema/interface_definition.rng5
-rwxr-xr-xscripts/build-command-templates9
2 files changed, 13 insertions, 1 deletions
diff --git a/schema/interface_definition.rng b/schema/interface_definition.rng
index d1bd9a708..5a0a48845 100644
--- a/schema/interface_definition.rng
+++ b/schema/interface_definition.rng
@@ -169,6 +169,11 @@
</element>
</optional>
<optional>
+ <element name="type">
+ <text/>
+ </element>
+ </optional>
+ <optional>
<!-- These are meaningful only for tag nodes -->
<group>
<element name="keepChildOrder">
diff --git a/scripts/build-command-templates b/scripts/build-command-templates
index ff0ce05f0..d1871c1c8 100755
--- a/scripts/build-command-templates
+++ b/scripts/build-command-templates
@@ -165,6 +165,12 @@ def get_properties(p):
except:
pass
+ # Get type
+ try:
+ props["type"] = p.find("type").text
+ except:
+ pass
+
# Get "multi"
if p.find("multi") is not None:
props["multi"] = True
@@ -233,7 +239,8 @@ def process_node(n, tmpl_dir):
props["owner"] = owner
# Type should not be set for non-tag, non-leaf nodes
if node_type != "node":
- props["type"] = "txt"
+ if "type" not in props.keys():
+ props["type"] = "txt"
if node_type == "tagNode":
props["tag"] = "True"