From 40c82fd472c4961e506acea86461833e9b244f98 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Mon, 5 May 2025 13:16:54 -0500 Subject: T7417: check existence of table setting before return_value Migration from 1.3.x may not contain table entries, later required. The migration script should not fail with error, leaving enforcement to config scripts. --- src/migration-scripts/vrf/2-to-3 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/migration-scripts/vrf/2-to-3') diff --git a/src/migration-scripts/vrf/2-to-3 b/src/migration-scripts/vrf/2-to-3 index acacffb41..5f396e7ed 100644 --- a/src/migration-scripts/vrf/2-to-3 +++ b/src/migration-scripts/vrf/2-to-3 @@ -76,7 +76,8 @@ def migrate(config: ConfigTree) -> None: # Get a list of all currently used VRFs and tables vrfs_current = {} for vrf in config.list_nodes(base): - vrfs_current[vrf] = int(config.return_value(base + [vrf, 'table'])) + if config.exists(base + [vrf, 'table']): + vrfs_current[vrf] = int(config.return_value(base + [vrf, 'table'])) # Check VRF names and table numbers name_regex = re.compile(r'^\d.*$') -- cgit v1.2.3