diff options
| author | John Estabrook <jestabro@vyos.io> | 2025-05-05 12:10:25 -0500 |
|---|---|---|
| committer | John Estabrook <jestabro@vyos.io> | 2025-05-05 13:20:26 -0500 |
| commit | 53ce5e378ace1d94dedeba0d84c353fbb3b59433 (patch) | |
| tree | d41aee60e1f53d2e9c260307b114b9464f9ead3d /src | |
| parent | 1142072141a73596fc8aa0822e8893274632f202 (diff) | |
| download | vyos-1x-53ce5e378ace1d94dedeba0d84c353fbb3b59433.tar.gz vyos-1x-53ce5e378ace1d94dedeba0d84c353fbb3b59433.zip | |
T7417: check existence of path before set_tag
The migration script assumed the existence of path
['vrf', 'name', tag-val-name, 'protocols', 'static', 'route']
ignoring sole entries for [..., 'route6'].
Check existence of each path before calling set_tag.
Diffstat (limited to 'src')
| -rw-r--r-- | src/migration-scripts/vrf/1-to-2 | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/migration-scripts/vrf/1-to-2 b/src/migration-scripts/vrf/1-to-2 index 557a9ec58..89b0f708a 100644 --- a/src/migration-scripts/vrf/1-to-2 +++ b/src/migration-scripts/vrf/1-to-2 @@ -37,7 +37,10 @@ def migrate(config: ConfigTree) -> None: new_static_base = vrf_base + [vrf, 'protocols'] config.set(new_static_base) config.copy(static_base, new_static_base + ['static']) - config.set_tag(new_static_base + ['static', 'route']) + if config.exists(new_static_base + ['static', 'route']): + config.set_tag(new_static_base + ['static', 'route']) + if config.exists(new_static_base + ['static', 'route6']): + config.set_tag(new_static_base + ['static', 'route6']) # Now delete the old configuration config.delete(base) |
