diff options
author | Christian Breunig <christian@breunig.cc> | 2024-12-18 19:17:33 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-12-18 19:17:33 +0100 |
commit | 75de2fa91c7d727eef9d38d045e0e04fba218695 (patch) | |
tree | f31d0915c680e0b6096751810b8c46a8130558ba /src | |
parent | 0b46e61379d2aa74f8b6e87dc94e801d0863e1ab (diff) | |
download | vyos-1x-75de2fa91c7d727eef9d38d045e0e04fba218695.tar.gz vyos-1x-75de2fa91c7d727eef9d38d045e0e04fba218695.zip |
vyos-configd: T6746: render resulting FRR configuration only once
Previously the FRR configuration was rendered via Jinja2 on every call to
get_frrendet_dict() - but it was used/applied only once.
We save the CPU cycles and render the FRR configuration only once prior to
applying it in FRR.
Diffstat (limited to 'src')
-rwxr-xr-x | src/services/vyos-configd | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/services/vyos-configd b/src/services/vyos-configd index ecad85801..500d5425f 100755 --- a/src/services/vyos-configd +++ b/src/services/vyos-configd @@ -33,6 +33,7 @@ import zmq from vyos.defaults import directories from vyos.utils.boot import boot_configuration_complete +from vyos.configdict import get_frrender_dict from vyos.configsource import ConfigSourceString from vyos.configsource import ConfigSourceError from vyos.configdiff import get_commit_scripts @@ -333,6 +334,8 @@ if __name__ == '__main__': if hasattr(config, 'frrender_cls') and res == R_SUCCESS: frrender_cls = getattr(config, 'frrender_cls') + tmp = get_frrender_dict(config) + frrender_cls.generate(tmp) frrender_cls.apply() else: logger.critical(f'Unexpected message: {message}') |