summaryrefslogtreecommitdiff
path: root/python/vyos/systemversions.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2021-08-19 11:36:06 -0500
committerJohn Estabrook <jestabro@vyos.io>2021-08-19 14:31:48 -0500
commitf0d13929835351d3d4519e2faa364a20888edb2e (patch)
treee2ffa685a6d6e69dbc3732064b6985ab07dbd223 /python/vyos/systemversions.py
parenta4e1a9235ff5e4aef29cc013239c6d842af5c1ae (diff)
downloadvyos-1x-f0d13929835351d3d4519e2faa364a20888edb2e.tar.gz
vyos-1x-f0d13929835351d3d4519e2faa364a20888edb2e.zip
T3768: Revert "T1950: Add support for reading component versions ..."
This reverts commit 29e438755c8bd2b9598a2016a3c42891f0cbfa1d.
Diffstat (limited to 'python/vyos/systemversions.py')
-rw-r--r--python/vyos/systemversions.py28
1 files changed, 2 insertions, 26 deletions
diff --git a/python/vyos/systemversions.py b/python/vyos/systemversions.py
index 5c4deca29..9b3f4f413 100644
--- a/python/vyos/systemversions.py
+++ b/python/vyos/systemversions.py
@@ -16,15 +16,12 @@
import os
import re
import sys
-import json
-
import vyos.defaults
def get_system_versions():
"""
- Get component versions from running system: read vyatta directory
- structure for versions, then read vyos JSON file. It is a critical
- error if either migration directory or JSON file is unreadable.
+ Get component versions from running system; critical failure if
+ unable to read migration directory.
"""
system_versions = {}
@@ -39,25 +36,4 @@ def get_system_versions():
pair = info.split('@')
system_versions[pair[0]] = int(pair[1])
- version_dict = {}
- path = vyos.defaults.version_file
-
- if os.path.isfile(path):
- with open(path, 'r') as f:
- try:
- version_dict = json.load(f)
- except ValueError as err:
- print(f"\nValue error in {path}: {err}")
- sys.exit(1)
-
- for k, v in version_dict.items():
- if not isinstance(v, int):
- print(f"\nType error in {path}; expecting Dict[str, int]")
- sys.exit(1)
- existing = system_versions.get(k)
- if existing is None:
- system_versions[k] = v
- elif v > existing:
- system_versions[k] = v
-
return system_versions