diff options
author | John Estabrook <jestabro@vyos.io> | 2022-02-17 09:30:55 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-17 09:30:55 -0600 |
commit | e66879f71da3383a84ebfe6235795e718c32bdb9 (patch) | |
tree | b60ad5df3baa2ee55567e2b00b83389b205062f5 /python/vyos/xml/definition.py | |
parent | f076f9f4cf6e6b7d89eada9f5d59bacea0f3af72 (diff) | |
parent | 425f8f16caa7e9e5101be3dc8ab32e60db274d7f (diff) | |
download | vyos-1x-e66879f71da3383a84ebfe6235795e718c32bdb9.tar.gz vyos-1x-e66879f71da3383a84ebfe6235795e718c32bdb9.zip |
Merge pull request #1225 from jestabro/component-version
T3474: move component version info to XML
Diffstat (limited to 'python/vyos/xml/definition.py')
-rw-r--r-- | python/vyos/xml/definition.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/python/vyos/xml/definition.py b/python/vyos/xml/definition.py index 5e0d5282c..bc3892b42 100644 --- a/python/vyos/xml/definition.py +++ b/python/vyos/xml/definition.py @@ -249,10 +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 component_version(self) -> dict: + d = {} + for k in sorted(self[kw.component_version]): + d[k] = int(self[kw.component_version][k]) + return d def defaults(self, lpath, flat): d = self[kw.default] |