From 9bfe2749a1fa41a4c77a3364851ac1fbefbf3ef3 Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Fri, 13 Feb 2026 12:29:00 +0200 Subject: vpp: T8254: Move 'nat44' and 'settings nat44' sections to 'nat nat44' --- src/migration-scripts/vpp/7-to-8 | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/migration-scripts') 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) -- cgit v1.2.3