summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/helpers/vyos_net_name14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/helpers/vyos_net_name b/src/helpers/vyos_net_name
index 13fb9e31f..e21d8c9ff 100755
--- a/src/helpers/vyos_net_name
+++ b/src/helpers/vyos_net_name
@@ -144,7 +144,19 @@ def get_configfile_interfaces() -> dict:
logging.critical(f"OSError {e}")
exit(1)
- config = ConfigTree(config_file)
+ try:
+ config = ConfigTree(config_file)
+ except Exception:
+ logging.debug(f"updating component version string syntax")
+ try:
+ # this will update the component version string in place, for
+ # updates 1.2 --> 1.3/1.4
+ os.system(f'/usr/libexec/vyos/run-config-migration.py {config_path} --virtual --set-vintage=vyos')
+ with open(config_path) as f:
+ config_file = f.read()
+ config = ConfigTree(config_file)
+ except Exception as e:
+ logging.critical(f"ConfigTree error: {e}")
base = ['interfaces', 'ethernet']
if config.exists(base):