diff options
author | Christian Breunig <christian@breunig.cc> | 2024-12-18 19:16:57 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-12-18 19:16:57 +0100 |
commit | 0b46e61379d2aa74f8b6e87dc94e801d0863e1ab (patch) | |
tree | 622e2d46379c5eb6960fe99f66193d4bd7bd8656 | |
parent | ce3b9dda7d832e5316657460518503ce72745285 (diff) | |
download | vyos-1x-0b46e61379d2aa74f8b6e87dc94e801d0863e1ab.tar.gz vyos-1x-0b46e61379d2aa74f8b6e87dc94e801d0863e1ab.zip |
frrender: T6746: rename config -> config_dict
-rw-r--r-- | python/vyos/frrender.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/python/vyos/frrender.py b/python/vyos/frrender.py index f8d18f207..ccadb3d1e 100644 --- a/python/vyos/frrender.py +++ b/python/vyos/frrender.py @@ -56,9 +56,9 @@ class FRRender: def __init__(self): self._frr_conf = '/run/frr/config/vyos.frr.conf' - def generate(self, config): - if not isinstance(config, dict): - tmp = type(config) + def generate(self, config_dict) -> None: + if not isinstance(config_dict, dict): + tmp = type(config_dict) raise ValueError(f'Config must be of type "dict" and not "{tmp}"!') def inline_helper(config_dict) -> str: @@ -127,18 +127,18 @@ class FRRender: output = '!\n' # Enable SNMP agentx support # SNMP AgentX support cannot be disabled once enabled - if 'snmp' in config: + if 'snmp' in config_dict: output += 'agentx\n' # Add routing protocols in global VRF - output += inline_helper(config) + output += inline_helper(config_dict) # Interface configuration for EVPN is not VRF related - if 'interfaces' in config: - output += render_to_string('frr/evpn.mh.frr.j2', {'interfaces' : config['interfaces']}) + if 'interfaces' in config_dict: + output += render_to_string('frr/evpn.mh.frr.j2', {'interfaces' : config_dict['interfaces']}) output += '\n' - if 'vrf' in config and 'name' in config['vrf']: - output += render_to_string('frr/zebra.vrf.route-map.frr.j2', config['vrf']) - for vrf, vrf_config in config['vrf']['name'].items(): + if 'vrf' in config_dict and 'name' in config_dict['vrf']: + output += render_to_string('frr/zebra.vrf.route-map.frr.j2', config_dict['vrf']) + for vrf, vrf_config in config_dict['vrf']['name'].items(): if 'protocols' not in vrf_config: continue for protocol in vrf_config['protocols']: |