summaryrefslogtreecommitdiff
path: root/python/vyos/xml/definition.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2021-08-13 12:01:04 -0500
committerJohn Estabrook <jestabro@vyos.io>2021-08-19 08:12:59 -0500
commit40f5359d2d34e322272b79f3905d26954311daa6 (patch)
tree6a1e224258f903757cbbdd9a21453c2d48b5419f /python/vyos/xml/definition.py
parent8114975668ac5d0f59bbc6abdc0df91e4c0d9995 (diff)
downloadvyos-1x-40f5359d2d34e322272b79f3905d26954311daa6.tar.gz
vyos-1x-40f5359d2d34e322272b79f3905d26954311daa6.zip
xml: T3474: add syntaxVersion processing to python xml lib
Diffstat (limited to 'python/vyos/xml/definition.py')
-rw-r--r--python/vyos/xml/definition.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/vyos/xml/definition.py b/python/vyos/xml/definition.py
index f556c5ced..5e0d5282c 100644
--- a/python/vyos/xml/definition.py
+++ b/python/vyos/xml/definition.py
@@ -30,6 +30,7 @@ class XML(dict):
self[kw.owners] = {}
self[kw.default] = {}
self[kw.tags] = []
+ self[kw.component_version] = {}
dict.__init__(self)
@@ -248,6 +249,11 @@ class XML(dict):
# @lru_cache(maxsize=100)
# XXX: need to use cachetool instead - for later
+ def component_versions(self) -> dict:
+ sort_component = sorted(self[kw.component_version].items(),
+ key = lambda kv: kv[0])
+ return dict(sort_component)
+
def defaults(self, lpath, flat):
d = self[kw.default]
for k in lpath: