summaryrefslogtreecommitdiff
path: root/python/vyos/xml/__init__.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2020-07-22 19:36:05 -0500
committerGitHub <noreply@github.com>2020-07-22 19:36:05 -0500
commit2c33099f8be42f8a1cb89d8b925377507c34c516 (patch)
tree5780fae80500ff6be5bc5503487d4fd5f2a82e43 /python/vyos/xml/__init__.py
parentda65aa2290e54f47dcc9c527723557fdbe2cb892 (diff)
parentfaaad2e029fd3520b62983dd78c7692434138360 (diff)
downloadvyos-1x-2c33099f8be42f8a1cb89d8b925377507c34c516.tar.gz
vyos-1x-2c33099f8be42f8a1cb89d8b925377507c34c516.zip
Merge pull request #481 from thomas-mangin/T2582
xml: T2582: use xml for is_tag and is_leaf
Diffstat (limited to 'python/vyos/xml/__init__.py')
-rw-r--r--python/vyos/xml/__init__.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/python/vyos/xml/__init__.py b/python/vyos/xml/__init__.py
index 6e0e73b1b..0f914fed2 100644
--- a/python/vyos/xml/__init__.py
+++ b/python/vyos/xml/__init__.py
@@ -35,6 +35,18 @@ def load_configuration(cache=[]):
return xml
+# def is_multi(lpath):
+# return load_configuration().is_multi(lpath)
+
+
+def is_tag(lpath):
+ return load_configuration().is_tag(lpath)
+
+
+def is_leaf(lpath, flat=True):
+ return load_configuration().is_leaf(lpath, flat)
+
+
def defaults(lpath, flat=False):
return load_configuration().defaults(lpath, flat)
@@ -42,3 +54,6 @@ def defaults(lpath, flat=False):
if __name__ == '__main__':
print(defaults(['service'], flat=True))
print(defaults(['service'], flat=False))
+
+ print(is_tag(["system", "login", "user", "vyos", "authentication", "public-keys"]))
+ print(is_tag(['protocols', 'static', 'multicast', 'route', '0.0.0.0/0', 'next-hop']))