diff options
| author | Nataliia Solomko <natalirs1985@gmail.com> | 2026-06-03 18:09:12 +0300 |
|---|---|---|
| committer | Nataliia Solomko <natalirs1985@gmail.com> | 2026-06-04 16:12:52 +0300 |
| commit | e27942887e7283fe79f39870965c42a3e63acfa2 (patch) | |
| tree | f90dcecdc8961aa3d731834cd418fb77c25d5d1b /python | |
| parent | 88dfc8cd43521ae489900fb9746c56545140df54 (diff) | |
| download | vyos-1x-e27942887e7283fe79f39870965c42a3e63acfa2.tar.gz vyos-1x-e27942887e7283fe79f39870965c42a3e63acfa2.zip | |
frr: T7931: Do not restart FRR on unrelated config changes when VRF protocols are configured
FRR was restarted on every commit when VRF protocols were configured, even when no
routing-related configuration changed. Root cause: the rendering loop mutated `config_dict`
in-place by injecting a `vrf` key into each VRF protocol sub-dict, polluting `cached_config_dict`
which holds a reference to the same object, causing the equality check to always fail on the
next commit.
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/frrender.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/python/vyos/frrender.py b/python/vyos/frrender.py index ff69f8266..27b8b8568 100644 --- a/python/vyos/frrender.py +++ b/python/vyos/frrender.py @@ -813,10 +813,15 @@ class FRRender: for vrf, vrf_config in config_dict['vrf']['name'].items(): if 'protocols' not in vrf_config: continue - for protocol in vrf_config['protocols']: - vrf_config['protocols'][protocol]['vrf'] = vrf - output += inline_helper(vrf_config['protocols']) + # Do not mutate config_dict in-place — it is also stored as + # cached_config_dict and in-place mutation breaks change + # detection on the next commit (T7931). + protocols = { + protocol: {**proto_dict, 'vrf': vrf} + for protocol, proto_dict in vrf_config['protocols'].items() + } + output += inline_helper(protocols) # remove any accidentally added empty newline to not confuse FRR output = os.linesep.join([s for s in output.splitlines() if s]) |
