From 75de2fa91c7d727eef9d38d045e0e04fba218695 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Wed, 18 Dec 2024 19:17:33 +0100 Subject: 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. --- src/services/vyos-configd | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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}') -- cgit v1.2.3