summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNataliia S. <81954790+natali-rs1985@users.noreply.github.com>2026-02-25 13:27:19 +0200
committerGitHub <noreply@github.com>2026-02-25 13:27:19 +0200
commit6fd7a87116ea91edbdbe86ed19c8274682d9ee8b (patch)
treeb59cdd8262d1546589a952e6d9544231d72ba34d /src
parent7fcca39afcafc9d99a58abc898460c975a5cdd34 (diff)
parente8c6a8f37470416e72a26fbbdfad24f8dcea7208 (diff)
downloadvyos-1x-6fd7a87116ea91edbdbe86ed19c8274682d9ee8b.tar.gz
vyos-1x-6fd7a87116ea91edbdbe86ed19c8274682d9ee8b.zip
Merge pull request #5008 from alexandr-san4ez/T8297-current
vpp: T8297: Fixed double enabling of VPP
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/vpp.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/conf_mode/vpp.py b/src/conf_mode/vpp.py
index b02c809ec..90356e6f4 100755
--- a/src/conf_mode/vpp.py
+++ b/src/conf_mode/vpp.py
@@ -231,10 +231,10 @@ def get_config(config=None):
# this is required because some interfaces after they are connected
# to VPP is really hard or impossible to restore without knowing
# their original parameters (like IDs)
- persist_config = JSONStorage('vpp_conf')
- eth_ifaces_persist: dict[str, dict[str, str]] = persist_config.read(
- 'eth_ifaces', {}
- )
+ with JSONStorage('vpp_conf') as persist_config:
+ eth_ifaces_persist: dict[str, dict[str, str]] = persist_config.read(
+ 'eth_ifaces', {}
+ )
if config:
conf = config
@@ -692,10 +692,10 @@ def apply(config):
modules = ('vfio_iommu_type1', 'vfio_pci', 'vfio_pci_core', 'vfio')
# Open persistent config
# It is required for operations with interfaces
- persist_config = JSONStorage('vpp_conf')
if not config or ('removed_ifaces' in config and 'settings' not in config):
# Cleanup persistent config
- persist_config.delete()
+ with JSONStorage('vpp_conf') as persist_config:
+ persist_config.delete()
# And stop the service
call(f'systemctl stop {service_name}.service')
# Unlod modules (modprobe -r)
@@ -869,7 +869,8 @@ def apply(config):
# Save persistent config
if 'persist_config' in config and config['persist_config']:
- persist_config.write('eth_ifaces', config['persist_config'])
+ with JSONStorage('vpp_conf') as persist_config:
+ persist_config.write('eth_ifaces', config['persist_config'])
# reinitialize interfaces, but not during the first boot
if boot_configuration_complete():