diff options
| author | Nataliia S. <81954790+natali-rs1985@users.noreply.github.com> | 2026-02-13 22:06:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-13 22:06:20 +0200 |
| commit | 984f41dcab36a2dee3c77908a3218594466647d6 (patch) | |
| tree | 3fc0335466fb72306ce7304502c3a9bcc27e378d /src/migration-scripts | |
| parent | 4d1b3346c60f77cced2acf87098ed959fbe5a500 (diff) | |
| parent | 9bfe2749a1fa41a4c77a3364851ac1fbefbf3ef3 (diff) | |
| download | vyos-1x-984f41dcab36a2dee3c77908a3218594466647d6.tar.gz vyos-1x-984f41dcab36a2dee3c77908a3218594466647d6.zip | |
Merge pull request #4985 from natali-rs1985/T8254
vpp: T8254: Move 'nat44' and 'settings nat44' sections to 'nat nat44'
Diffstat (limited to 'src/migration-scripts')
| -rw-r--r-- | src/migration-scripts/vpp/7-to-8 | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/migration-scripts/vpp/7-to-8 b/src/migration-scripts/vpp/7-to-8 index dfe2f5013..e6cff9668 100644 --- a/src/migration-scripts/vpp/7-to-8 +++ b/src/migration-scripts/vpp/7-to-8 @@ -16,6 +16,9 @@ # Rename `vpp settings logging default-log-level` to # `vpp settings logging default-level` (T8255) # +# Move 'vpp nat44' and 'vpp settings nat44' to 'vpp nat nat44'. +# Drop settings for nat workers (T8254) + from vyos.configtree import ConfigTree @@ -26,5 +29,36 @@ def _migrate_vpp_log(config: ConfigTree) -> None: config.rename(base + ['default-log-level'], 'default-level') +def _migrate_vpp_nat44(config: ConfigTree) -> None: + base_path = ['vpp', 'nat44'] + new_base_path = ['vpp', 'nat', 'nat44'] + settings_path = ['vpp', 'settings', 'nat44'] + + if not config.exists(base_path): + # Nothing to do + return + + if not config.exists(['vpp', 'nat']): + config.set(['vpp', 'nat']) + + # copy "vpp nat44" to "vpp nat nat44" + config.copy(base_path, new_base_path) + config.delete(base_path) + + # move 'vpp settings nat44' to 'vpp nat nat44' + if config.exists(settings_path): + if config.exists(settings_path + ['session-limit']): + session_limit = config.return_value(settings_path + ['session-limit']) + config.set(new_base_path + ['session-limit'], value=session_limit) + if config.exists(settings_path + ['timeout']): + config.copy(settings_path + ['timeout'], new_base_path + ['timeout']) + config.delete(settings_path) + + def migrate(config: ConfigTree) -> None: + if not config.exists(['vpp']): + # Nothing to do + return + _migrate_vpp_log(config) + _migrate_vpp_nat44(config) |
