diff options
| author | Christian Breunig <christian@breunig.cc> | 2025-12-12 20:54:52 +0100 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2025-12-12 20:54:52 +0100 |
| commit | 72ca8476e2ef69d048e86a37027fd27910972a32 (patch) | |
| tree | de78e9b17e11a0102129069bb61c82d7eb82c1a0 /src | |
| parent | aa3b597230ebdd860101c031a26acebacdbf8caf (diff) | |
| download | vyos-1x-72ca8476e2ef69d048e86a37027fd27910972a32.tar.gz vyos-1x-72ca8476e2ef69d048e86a37027fd27910972a32.zip | |
isis: T8094: bugfix config migration from 1.3.0-rc1 -> 1.4
While producing all configtest assert files for VyOS 1.4 it was noted that
the the isis-small testcase from fails. This config fragment is not properly
migrated when updating from VyOS 1.3.0-rc1 -> 1.4 and using IS-IS.
protocols {
isis FOO {
interface eth1 {
bfd
}
net 49.0001.1921.6800.1002.00
redistribute {
ipv4 {
connected {
level-2 {
route-map EXPORT-ISIS
}
}
}
}
}
}
and results in loosing IS-IS connectivity. This is due the fact that
config.rename() does not work when only using the base tagNode.
Diffstat (limited to 'src')
| -rw-r--r-- | src/migration-scripts/isis/0-to-1 | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/migration-scripts/isis/0-to-1 b/src/migration-scripts/isis/0-to-1 index 052dbc8a8..3a9735d29 100644 --- a/src/migration-scripts/isis/0-to-1 +++ b/src/migration-scripts/isis/0-to-1 @@ -24,13 +24,21 @@ def migrate(config: ConfigTree) -> None: # Nothing to do return - # We need a temporary copy of the config - tmp_base = ['protocols', 'isis2'] - config.copy(base, tmp_base) + if not config.is_tag(base): + # Nothing to do + exit(0) + + # Get IS-IS domain ID + domain_id = config.list_nodes(base) + if domain_id: + # We need a temporary copy of the config + tmp_base = ['protocols', 'isis2'] + config.copy(base + domain_id, tmp_base) # Now it's save to delete the old configuration config.delete(base) - # Rename temporary copy to new final config (IS-IS domain key is static and no - # longer required to be set via CLI) - config.rename(tmp_base, 'isis') + # Rename temporary node to new final config (IS-IS domain key is static and + # no longer required to be set via CLI) + if config.exists(tmp_base): + config.rename(tmp_base, 'isis') |
