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. --- python/vyos/configdict.py | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'python') diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index cbcbf9f72..17a5fd7bb 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -19,7 +19,6 @@ A library for retrieving value dicts from VyOS configs in a declarative fashion. import os import json -from vyos.defaults import frr_debug_enable from vyos.utils.dict import dict_search from vyos.utils.process import cmd @@ -1146,16 +1145,4 @@ def get_frrender_dict(conf, argv=None) -> dict: dict.update({'vrf' : vrf}) - if os.path.exists(frr_debug_enable): - print('======== < BEGIN > ==========') - import pprint - pprint.pprint(dict) - print('========= < END > ===========') - - # 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) - return dict -- cgit v1.2.3