summaryrefslogtreecommitdiff
path: root/src/migration-scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-01-11 12:01:23 +0100
committerChristian Poessinger <christian@poessinger.com>2022-01-11 12:02:11 +0100
commit29efbf51efea559773f61703f11a77a8aee6de36 (patch)
treeb8013c3e351ffb3fa52d58dc7d43cbf1b42812ba /src/migration-scripts
parentd5775339f9d1ee33c04f5d923684cd254b400364 (diff)
downloadvyos-1x-29efbf51efea559773f61703f11a77a8aee6de36.tar.gz
vyos-1x-29efbf51efea559773f61703f11a77a8aee6de36.zip
migrator: interfaces: T4171: bugfix ConfigTreeError
Migrating 1.2.8 -> 1.4-rolling-202201110811 vyos-router[970]: Waiting for NICs to settle down: settled in 0sec.. vyos-router[1085]: Started watchfrr. vyos-router[970]: Mounting VyOS Config...done. vyos-router[970]: Starting VyOS router: migrate vyos-router[1490]: Traceback (most recent call last): vyos-router[1490]: File "/opt/vyatta/etc/config-migrate/migrate/interfaces/5-to-6", line 112, in <module> vyos-router[1490]: for if_type in config.list_nodes(['interfaces']): vyos-router[1490]: File "/usr/lib/python3/dist-packages/vyos/configtree.py", line 236, in list_nodes vyos-router[1490]: raise ConfigTreeError("Path [{}] doesn't exist".format(path_str)) vyos-router[1490]: vyos.configtree.ConfigTreeError: Path [b'interfaces'] doesn't exist vyos-router[1455]: Migration script error: /opt/vyatta/etc/config-migrate/migrate/interfaces/5-to-6: Command '['/opt/vyatta/etc/config-migrate/migrate/interfaces/5-to-6', '/opt/vyatta/etc/config/config.boot']' returned non-zero exit status 1.. vyos-router[970]: configure. vyos-config[979]: Configuration success
Diffstat (limited to 'src/migration-scripts')
-rwxr-xr-xsrc/migration-scripts/interfaces/5-to-69
1 files changed, 7 insertions, 2 deletions
diff --git a/src/migration-scripts/interfaces/5-to-6 b/src/migration-scripts/interfaces/5-to-6
index ae79c1d1b..dc8d9554f 100755
--- a/src/migration-scripts/interfaces/5-to-6
+++ b/src/migration-scripts/interfaces/5-to-6
@@ -107,10 +107,15 @@ if __name__ == '__main__':
config_file = f.read()
config = ConfigTree(config_file)
+ base = ['interfaces']
+
+ if not config.exists(base):
+ # Nothing to do
+ exit(0)
# list all individual interface types like dummy, ethernet and so on
- for if_type in config.list_nodes(['interfaces']):
- base_if_type = ['interfaces', if_type]
+ for if_type in config.list_nodes(base):
+ base_if_type = base + [if_type]
# for every individual interface we need to check if there is an
# ipv6 ra configured ... and also for every VIF (VLAN) interface