diff options
author | Christian Breunig <christian@breunig.cc> | 2024-12-08 16:33:45 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-12-16 22:24:50 +0100 |
commit | 779f311e7fe81e3c85de28f13e4e12e33b255483 (patch) | |
tree | a7edc34394439a03b019be94cadd1837bcb7f7e0 /python | |
parent | 1666e3d99b8de700c880f09ce6ad5ea8bc7f4568 (diff) | |
download | vyos-1x-779f311e7fe81e3c85de28f13e4e12e33b255483.tar.gz vyos-1x-779f311e7fe81e3c85de28f13e4e12e33b255483.zip |
frr: T6746: integrate FRRender class into vyos-configd
When running under vyos-configd only a single apply() is done as last step in
the commit algorithm. FRRender class address is provided via an attribute from
vyos-configd process.
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/configdict.py | 6 | ||||
-rw-r--r-- | python/vyos/frrender.py | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index c7384f71d..baffd94dd 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -1125,6 +1125,12 @@ def get_frrender_dict(conf) -> dict: dict.update({'vrf' : vrf}) + # Use singleton instance of the FRR render class + if hasattr(conf, 'frrender_cls'): + frrender = getattr(conf, 'frrender_cls') + dict.update({'frrender_cls' : frrender}) + frrender.generate(dict) + if os.path.exists(frr_debug_enable): print('======== < BEGIN > ==========') import pprint diff --git a/python/vyos/frrender.py b/python/vyos/frrender.py index 2069930a9..e02094bbb 100644 --- a/python/vyos/frrender.py +++ b/python/vyos/frrender.py @@ -136,7 +136,7 @@ class FRRender: emsg = '' while count < count_max: count += 1 - print('FRR: Reloading configuration', count) + print('FRR: Reloading configuration - tries:', count, 'Python class ID:', id(self)) cmdline = '/usr/lib/frr/frr-reload.py --reload' if DEBUG_ON: |