summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2022-05-25 10:21:25 -0500
committerJohn Estabrook <jestabro@vyos.io>2022-05-25 11:42:44 -0500
commitd8ce60dd846792fec76af92151d470a4169f163d (patch)
tree5f213d56184a765877a657ce6612f08af8979be6
parent9375ded103b4747c9a23965687af3e7289e8721d (diff)
downloadvyos-1x-d8ce60dd846792fec76af92151d470a4169f163d.tar.gz
vyos-1x-d8ce60dd846792fec76af92151d470a4169f163d.zip
configtest: T4382: missing block in migration script vrf/0-to-1
The config vrf-basic reveals a missing block in the migration script vrf/0-to-1, moving 'next-hop-vrf' to 'vrf'. As this only exists in Sagitta, modify script 0-to-1. Also, fix the 'system nt' typo seen in vrf-ospf.
-rw-r--r--smoketest/configs/vrf-basic1
-rwxr-xr-xsrc/migration-scripts/vrf/0-to-110
2 files changed, 10 insertions, 1 deletions
diff --git a/smoketest/configs/vrf-basic b/smoketest/configs/vrf-basic
index ded33f683..20ac7a92f 100644
--- a/smoketest/configs/vrf-basic
+++ b/smoketest/configs/vrf-basic
@@ -196,7 +196,6 @@ system {
}
}
}
- nt
ntp {
server 0.pool.ntp.org {
}
diff --git a/src/migration-scripts/vrf/0-to-1 b/src/migration-scripts/vrf/0-to-1
index 2b41ef3c7..5df751113 100755
--- a/src/migration-scripts/vrf/0-to-1
+++ b/src/migration-scripts/vrf/0-to-1
@@ -114,6 +114,16 @@ for vrf in config.list_nodes(base):
if config.exists(vrf_path):
config.rename(vrf_path, 'vrf')
+ next_hop = route_path + [route, 'interface']
+ if config.exists(next_hop):
+ for interface in config.list_nodes(next_hop):
+ interface_path = next_hop + [interface, 'next-hop-interface']
+ if config.exists(interface_path):
+ config.rename(interface_path, 'interface')
+ vrf_path = next_hop + [interface, 'next-hop-vrf']
+ if config.exists(vrf_path):
+ config.rename(vrf_path, 'vrf')
+
try:
with open(file_name, 'w') as f:
f.write(config.to_string())