diff options
author | Christian Breunig <christian@breunig.cc> | 2024-10-06 15:17:17 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-12-16 22:21:36 +0100 |
commit | 81923562a8a164f7ff9761e976c20420a585907a (patch) | |
tree | 8fe525e8ab4bb0d07f9eb52b52816e50bcb956cf /src | |
parent | 7538fd4c518271a517b6753dd664fd07cd86bddd (diff) | |
download | vyos-1x-81923562a8a164f7ff9761e976c20420a585907a.tar.gz vyos-1x-81923562a8a164f7ff9761e976c20420a585907a.zip |
frr: T6747: make daemon definitions re-usable for both conf-mode and smoketests
Diffstat (limited to 'src')
24 files changed, 55 insertions, 113 deletions
diff --git a/src/conf_mode/interfaces_bonding.py b/src/conf_mode/interfaces_bonding.py index bbbfb0385..633fb797c 100755 --- a/src/conf_mode/interfaces_bonding.py +++ b/src/conf_mode/interfaces_bonding.py @@ -281,16 +281,15 @@ def apply(bond): raise ConfigError('Error in updating ethernet interface ' 'after deleting it from bond') - zebra_daemon = 'zebra' # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() # The route-map used for the FIB (zebra) is part of the zebra daemon - frr_cfg.load_configuration(zebra_daemon) + frr_cfg.load_configuration(frr.mgmt_daemon) frr_cfg.modify_section(f'^interface {ifname}', stop_pattern='^exit', remove_stop_mark=True) if 'frr_zebra_config' in bond: frr_cfg.add_before(frr.default_add_before, bond['frr_zebra_config']) - frr_cfg.commit_configuration(zebra_daemon) + frr_cfg.commit_configuration() return None diff --git a/src/conf_mode/interfaces_ethernet.py b/src/conf_mode/interfaces_ethernet.py index 34ce7bc47..edbbb00c9 100755 --- a/src/conf_mode/interfaces_ethernet.py +++ b/src/conf_mode/interfaces_ethernet.py @@ -337,16 +337,13 @@ def apply(ethernet): else: e.update(ethernet) - zebra_daemon = 'zebra' # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - - # The route-map used for the FIB (zebra) is part of the zebra daemon - frr_cfg.load_configuration(zebra_daemon) + frr_cfg.load_configuration(frr.mgmt_daemon) frr_cfg.modify_section(f'^interface {ifname}', stop_pattern='^exit', remove_stop_mark=True) if 'frr_zebra_config' in ethernet: frr_cfg.add_before(frr.default_add_before, ethernet['frr_zebra_config']) - frr_cfg.commit_configuration(zebra_daemon) + frr_cfg.commit_configuration() if __name__ == '__main__': try: diff --git a/src/conf_mode/policy.py b/src/conf_mode/policy.py index a5963e72c..aef9b96c4 100755 --- a/src/conf_mode/policy.py +++ b/src/conf_mode/policy.py @@ -279,14 +279,11 @@ def generate(policy): def apply(policy): - bgp_daemon = 'bgpd' - zebra_daemon = 'zebra' - # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() # The route-map used for the FIB (zebra) is part of the zebra daemon - frr_cfg.load_configuration(bgp_daemon) + frr_cfg.load_configuration(frr.bgp_daemon) frr_cfg.modify_section(r'^bgp as-path access-list .*') frr_cfg.modify_section(r'^bgp community-list .*') frr_cfg.modify_section(r'^bgp extcommunity-list .*') @@ -295,10 +292,10 @@ def apply(policy): remove_stop_mark=True) if 'new_frr_config' in policy: frr_cfg.add_before(frr.default_add_before, policy['new_frr_config']) - frr_cfg.commit_configuration(bgp_daemon) + frr_cfg.commit_configuration(frr.bgp_daemon) # The route-map used for the FIB (zebra) is part of the zebra daemon - frr_cfg.load_configuration(zebra_daemon) + frr_cfg.load_configuration(frr.zebra_daemon) frr_cfg.modify_section(r'^access-list .*') frr_cfg.modify_section(r'^ipv6 access-list .*') frr_cfg.modify_section(r'^ip prefix-list .*') @@ -307,7 +304,7 @@ def apply(policy): remove_stop_mark=True) if 'new_frr_config' in policy: frr_cfg.add_before(frr.default_add_before, policy['new_frr_config']) - frr_cfg.commit_configuration(zebra_daemon) + frr_cfg.commit_configuration(frr.zebra_daemon) return None diff --git a/src/conf_mode/protocols_babel.py b/src/conf_mode/protocols_babel.py index 90b6e4a31..06fd9b9b6 100755 --- a/src/conf_mode/protocols_babel.py +++ b/src/conf_mode/protocols_babel.py @@ -128,12 +128,10 @@ def generate(babel): return None def apply(babel): - babel_daemon = 'babeld' - # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - frr_cfg.load_configuration(babel_daemon) + frr_cfg.load_configuration(frr.babel_daemon) frr_cfg.modify_section('^router babel', stop_pattern='^exit', remove_stop_mark=True) for key in ['interface', 'interface_removed']: @@ -144,7 +142,7 @@ def apply(babel): if 'new_frr_config' in babel: frr_cfg.add_before(frr.default_add_before, babel['new_frr_config']) - frr_cfg.commit_configuration(babel_daemon) + frr_cfg.commit_configuration(frr.babel_daemon) return None diff --git a/src/conf_mode/protocols_bfd.py b/src/conf_mode/protocols_bfd.py index 1361bb1a9..d94ec6a0d 100755 --- a/src/conf_mode/protocols_bfd.py +++ b/src/conf_mode/protocols_bfd.py @@ -89,15 +89,13 @@ def generate(bfd): bfd['new_frr_config'] = render_to_string('frr/bfdd.frr.j2', bfd) def apply(bfd): - bfd_daemon = 'bfdd' - # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - frr_cfg.load_configuration(bfd_daemon) + frr_cfg.load_configuration(frr.bfd_daemon) frr_cfg.modify_section('^bfd', stop_pattern='^exit', remove_stop_mark=True) if 'new_frr_config' in bfd: frr_cfg.add_before(frr.default_add_before, bfd['new_frr_config']) - frr_cfg.commit_configuration(bfd_daemon) + frr_cfg.commit_configuration(frr.bfd_daemon) return None diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py index 22f020099..e5c46aee6 100755 --- a/src/conf_mode/protocols_bgp.py +++ b/src/conf_mode/protocols_bgp.py @@ -617,8 +617,6 @@ def apply(bgp): if {'vrf', 'vni'} <= set(bgp): call('vtysh -c "conf t" -c "vrf {vrf}" -c "no vni {vni}"'.format(**bgp)) - bgp_daemon = 'bgpd' - # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() @@ -628,7 +626,7 @@ def apply(bgp): if 'vrf' in bgp: vrf = ' vrf ' + bgp['vrf'] - frr_cfg.load_configuration(bgp_daemon) + frr_cfg.load_configuration(frr.bgp_daemon) # Remove interface specific config for key in ['interface', 'interface_removed']: @@ -640,7 +638,7 @@ def apply(bgp): frr_cfg.modify_section(f'^router bgp \d+{vrf}', stop_pattern='^exit', remove_stop_mark=True) if 'frr_bgpd_config' in bgp: frr_cfg.add_before(frr.default_add_before, bgp['frr_bgpd_config']) - frr_cfg.commit_configuration(bgp_daemon) + frr_cfg.commit_configuration(frr.bgp_daemon) return None diff --git a/src/conf_mode/protocols_eigrp.py b/src/conf_mode/protocols_eigrp.py index c13e52a3d..a948b47da 100755 --- a/src/conf_mode/protocols_eigrp.py +++ b/src/conf_mode/protocols_eigrp.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2022 VyOS maintainers and contributors +# Copyright (C) 2022-2024 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -89,8 +89,6 @@ def generate(eigrp): eigrp['frr_eigrpd_config'] = render_to_string('frr/eigrpd.frr.j2', eigrp) def apply(eigrp): - eigrp_daemon = 'eigrpd' - # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() @@ -100,11 +98,11 @@ def apply(eigrp): if 'vrf' in eigrp: vrf = ' vrf ' + eigrp['vrf'] - frr_cfg.load_configuration(eigrp_daemon) + frr_cfg.load_configuration(frr.eigrp_daemon) frr_cfg.modify_section(f'^router eigrp \d+{vrf}', stop_pattern='^exit', remove_stop_mark=True) if 'frr_eigrpd_config' in eigrp: frr_cfg.add_before(frr.default_add_before, eigrp['frr_eigrpd_config']) - frr_cfg.commit_configuration(eigrp_daemon) + frr_cfg.commit_configuration(frr.eigrp_daemon) return None diff --git a/src/conf_mode/protocols_isis.py b/src/conf_mode/protocols_isis.py index ba2f3cf0d..9b70c7329 100755 --- a/src/conf_mode/protocols_isis.py +++ b/src/conf_mode/protocols_isis.py @@ -274,8 +274,6 @@ def generate(isis): return None def apply(isis): - isis_daemon = 'isisd' - # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() @@ -285,7 +283,7 @@ def apply(isis): if 'vrf' in isis: vrf = ' vrf ' + isis['vrf'] - frr_cfg.load_configuration(isis_daemon) + frr_cfg.load_configuration(frr.isis_daemon) frr_cfg.modify_section(f'^router isis VyOS{vrf}', stop_pattern='^exit', remove_stop_mark=True) for key in ['interface', 'interface_removed']: @@ -297,7 +295,7 @@ def apply(isis): if 'frr_isisd_config' in isis: frr_cfg.add_before(frr.default_add_before, isis['frr_isisd_config']) - frr_cfg.commit_configuration(isis_daemon) + frr_cfg.commit_configuration(frr.isis_daemon) return None diff --git a/src/conf_mode/protocols_mpls.py b/src/conf_mode/protocols_mpls.py index ad164db9f..4a05b8044 100755 --- a/src/conf_mode/protocols_mpls.py +++ b/src/conf_mode/protocols_mpls.py @@ -77,17 +77,15 @@ def generate(mpls): return None def apply(mpls): - ldpd_damon = 'ldpd' - # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - frr_cfg.load_configuration(ldpd_damon) + frr_cfg.load_configuration(frr.ldpd_daemon) frr_cfg.modify_section(f'^mpls ldp', stop_pattern='^exit', remove_stop_mark=True) if 'frr_ldpd_config' in mpls: frr_cfg.add_before(frr.default_add_before, mpls['frr_ldpd_config']) - frr_cfg.commit_configuration(ldpd_damon) + frr_cfg.commit_configuration(frr.ldpd_daemon) # Set number of entries in the platform label tables labels = '0' diff --git a/src/conf_mode/protocols_openfabric.py b/src/conf_mode/protocols_openfabric.py index 8e8c50c06..b60117a02 100644 --- a/src/conf_mode/protocols_openfabric.py +++ b/src/conf_mode/protocols_openfabric.py @@ -115,12 +115,10 @@ def generate(openfabric): return None def apply(openfabric): - openfabric_daemon = 'fabricd' - # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - frr_cfg.load_configuration(openfabric_daemon) + frr_cfg.load_configuration(frr.openfabric_daemon) for domain in openfabric['domains_all']: frr_cfg.modify_section(f'^router openfabric {domain}', stop_pattern='^exit', remove_stop_mark=True) @@ -130,7 +128,7 @@ def apply(openfabric): if 'frr_fabricd_config' in openfabric: frr_cfg.add_before(frr.default_add_before, openfabric['frr_fabricd_config']) - frr_cfg.commit_configuration(openfabric_daemon) + frr_cfg.commit_configuration(frr.openfabric_daemon) return None diff --git a/src/conf_mode/protocols_ospf.py b/src/conf_mode/protocols_ospf.py index 7347c4faa..44817b9b7 100755 --- a/src/conf_mode/protocols_ospf.py +++ b/src/conf_mode/protocols_ospf.py @@ -252,8 +252,6 @@ def generate(ospf): return None def apply(ospf): - ospf_daemon = 'ospfd' - # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() @@ -263,7 +261,7 @@ def apply(ospf): if 'vrf' in ospf: vrf = ' vrf ' + ospf['vrf'] - frr_cfg.load_configuration(ospf_daemon) + frr_cfg.load_configuration(frr.ospf_daemon) frr_cfg.modify_section(f'^router ospf{vrf}', stop_pattern='^exit', remove_stop_mark=True) for key in ['interface', 'interface_removed']: @@ -275,7 +273,7 @@ def apply(ospf): if 'frr_ospfd_config' in ospf: frr_cfg.add_before(frr.default_add_before, ospf['frr_ospfd_config']) - frr_cfg.commit_configuration(ospf_daemon) + frr_cfg.commit_configuration(frr.ospf_daemon) return None diff --git a/src/conf_mode/protocols_ospfv3.py b/src/conf_mode/protocols_ospfv3.py index 60c2a9b16..7bdab3017 100755 --- a/src/conf_mode/protocols_ospfv3.py +++ b/src/conf_mode/protocols_ospfv3.py @@ -153,8 +153,6 @@ def generate(ospfv3): return None def apply(ospfv3): - ospf6_daemon = 'ospf6d' - # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() @@ -164,7 +162,7 @@ def apply(ospfv3): if 'vrf' in ospfv3: vrf = ' vrf ' + ospfv3['vrf'] - frr_cfg.load_configuration(ospf6_daemon) + frr_cfg.load_configuration(frr.ospf6_daemon) frr_cfg.modify_section(f'^router ospf6{vrf}', stop_pattern='^exit', remove_stop_mark=True) for key in ['interface', 'interface_removed']: @@ -176,7 +174,7 @@ def apply(ospfv3): if 'new_frr_config' in ospfv3: frr_cfg.add_before(frr.default_add_before, ospfv3['new_frr_config']) - frr_cfg.commit_configuration(ospf6_daemon) + frr_cfg.commit_configuration(frr.ospf6_daemon) return None diff --git a/src/conf_mode/protocols_pim.py b/src/conf_mode/protocols_pim.py index 79294a1f0..9ef734eff 100755 --- a/src/conf_mode/protocols_pim.py +++ b/src/conf_mode/protocols_pim.py @@ -131,8 +131,7 @@ def generate(pim): return None def apply(pim): - pim_daemon = 'pimd' - pim_pid = process_named_running(pim_daemon) + pim_pid = process_named_running(frr.pim_daemon) if not pim or 'deleted' in pim: if 'deleted' in pim: @@ -146,7 +145,7 @@ def apply(pim): # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - frr_cfg.load_configuration(pim_daemon) + frr_cfg.load_configuration(frr.pim_daemon) frr_cfg.modify_section(f'^ip pim') frr_cfg.modify_section(f'^ip igmp') @@ -158,7 +157,7 @@ def apply(pim): if 'frr_pimd_config' in pim: frr_cfg.add_before(frr.default_add_before, pim['frr_pimd_config']) - frr_cfg.commit_configuration(pim_daemon) + frr_cfg.commit_configuration(frr.pim_daemon) return None if __name__ == '__main__': diff --git a/src/conf_mode/protocols_pim6.py b/src/conf_mode/protocols_pim6.py index 581ffe238..1abc256fe 100755 --- a/src/conf_mode/protocols_pim6.py +++ b/src/conf_mode/protocols_pim6.py @@ -104,12 +104,9 @@ def apply(pim6): if pim6 is None: return - pim6_daemon = 'pim6d' - # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - - frr_cfg.load_configuration(pim6_daemon) + frr_cfg.load_configuration(frr.pim6_daemon) for key in ['interface', 'interface_removed']: if key not in pim6: @@ -119,7 +116,7 @@ def apply(pim6): if 'new_frr_config' in pim6: frr_cfg.add_before(frr.default_add_before, pim6['new_frr_config']) - frr_cfg.commit_configuration(pim6_daemon) + frr_cfg.commit_configuration(frr.pim6_daemon) return None if __name__ == '__main__': diff --git a/src/conf_mode/protocols_rip.py b/src/conf_mode/protocols_rip.py index 9afac544d..994007137 100755 --- a/src/conf_mode/protocols_rip.py +++ b/src/conf_mode/protocols_rip.py @@ -101,18 +101,12 @@ def generate(rip): return None def apply(rip): - rip_daemon = 'ripd' - zebra_daemon = 'zebra' - # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - # The route-map used for the FIB (zebra) is part of the zebra daemon - frr_cfg.load_configuration(zebra_daemon) + # The route-map used for the FIB (zebra) is part of the mgmt daemon as of FRR 10.1 + frr_cfg.load_configuration(frr.mgmt_daemon) frr_cfg.modify_section('^ip protocol rip route-map [-a-zA-Z0-9.]+', stop_pattern='(\s|!)') - frr_cfg.commit_configuration(zebra_daemon) - - frr_cfg.load_configuration(rip_daemon) frr_cfg.modify_section('^key chain \S+', stop_pattern='^exit', remove_stop_mark=True) frr_cfg.modify_section('^router rip', stop_pattern='^exit', remove_stop_mark=True) @@ -124,7 +118,7 @@ def apply(rip): if 'new_frr_config' in rip: frr_cfg.add_before(frr.default_add_before, rip['new_frr_config']) - frr_cfg.commit_configuration(rip_daemon) + frr_cfg.commit_configuration() return None diff --git a/src/conf_mode/protocols_ripng.py b/src/conf_mode/protocols_ripng.py index 23416ff96..9d4447d1f 100755 --- a/src/conf_mode/protocols_ripng.py +++ b/src/conf_mode/protocols_ripng.py @@ -85,31 +85,22 @@ def verify(ripng): def generate(ripng): if not ripng: - ripng['new_frr_config'] = '' return None - ripng['new_frr_config'] = render_to_string('frr/ripngd.frr.j2', ripng) - return None def apply(ripng): - ripng_daemon = 'ripngd' - zebra_daemon = 'zebra' - # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() # The route-map used for the FIB (zebra) is part of the zebra daemon - frr_cfg.load_configuration(zebra_daemon) + frr_cfg.load_configuration(frr.mgmt_daemon) frr_cfg.modify_section('^ipv6 protocol ripng route-map [-a-zA-Z0-9.]+', stop_pattern='(\s|!)') - frr_cfg.commit_configuration(zebra_daemon) - - frr_cfg.load_configuration(ripng_daemon) frr_cfg.modify_section('key chain \S+', stop_pattern='^exit', remove_stop_mark=True) frr_cfg.modify_section('interface \S+', stop_pattern='^exit', remove_stop_mark=True) frr_cfg.modify_section('^router ripng', stop_pattern='^exit', remove_stop_mark=True) if 'new_frr_config' in ripng: frr_cfg.add_before(frr.default_add_before, ripng['new_frr_config']) - frr_cfg.commit_configuration(ripng_daemon) + frr_cfg.commit_configuration() return None diff --git a/src/conf_mode/protocols_rpki.py b/src/conf_mode/protocols_rpki.py index a59ecf3e4..bec0cda91 100755 --- a/src/conf_mode/protocols_rpki.py +++ b/src/conf_mode/protocols_rpki.py @@ -107,16 +107,14 @@ def generate(rpki): return None def apply(rpki): - bgp_daemon = 'bgpd' - # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - frr_cfg.load_configuration(bgp_daemon) + frr_cfg.load_configuration(frr.bgp_daemon) frr_cfg.modify_section('^rpki', stop_pattern='^exit', remove_stop_mark=True) if 'new_frr_config' in rpki: frr_cfg.add_before(frr.default_add_before, rpki['new_frr_config']) - frr_cfg.commit_configuration(bgp_daemon) + frr_cfg.commit_configuration(frr.bgp_daemon) return None if __name__ == '__main__': diff --git a/src/conf_mode/protocols_segment-routing.py b/src/conf_mode/protocols_segment-routing.py index b36c2ca11..67f8005ef 100755 --- a/src/conf_mode/protocols_segment-routing.py +++ b/src/conf_mode/protocols_segment-routing.py @@ -70,8 +70,6 @@ def generate(sr): return None def apply(sr): - zebra_daemon = 'zebra' - if 'interface_removed' in sr: for interface in sr['interface_removed']: # Disable processing of IPv6-SR packets @@ -97,11 +95,11 @@ def apply(sr): # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - frr_cfg.load_configuration(zebra_daemon) + frr_cfg.load_configuration(frr.zebra_daemon) frr_cfg.modify_section(r'^segment-routing') if 'new_frr_config' in sr: frr_cfg.add_before(frr.default_add_before, sr['new_frr_config']) - frr_cfg.commit_configuration(zebra_daemon) + frr_cfg.commit_configuration(frr.zebra_daemon) return None diff --git a/src/conf_mode/protocols_static.py b/src/conf_mode/protocols_static.py index 430cc69d4..c5dc77fd2 100755 --- a/src/conf_mode/protocols_static.py +++ b/src/conf_mode/protocols_static.py @@ -102,11 +102,9 @@ def generate(static): return None def apply(static): - static_daemon = 'staticd' - # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - frr_cfg.load_configuration(static_daemon) + frr_cfg.load_configuration(frr.mgmt_daemon) if 'vrf' in static: vrf = static['vrf'] @@ -117,7 +115,7 @@ def apply(static): if 'new_frr_config' in static: frr_cfg.add_before(frr.default_add_before, static['new_frr_config']) - frr_cfg.commit_configuration(static_daemon) + frr_cfg.commit_configuration() return None diff --git a/src/conf_mode/protocols_static_multicast.py b/src/conf_mode/protocols_static_multicast.py index c8894fd41..4393f3ed3 100755 --- a/src/conf_mode/protocols_static_multicast.py +++ b/src/conf_mode/protocols_static_multicast.py @@ -103,10 +103,9 @@ def generate(mroute): def apply(mroute): if mroute is None: return None - static_daemon = 'staticd' frr_cfg = frr.FRRConfig() - frr_cfg.load_configuration(static_daemon) + frr_cfg.load_configuration(frr.mgmt_daemon) if 'old_mroute' in mroute: for route_gr in mroute['old_mroute']: @@ -119,8 +118,7 @@ def apply(mroute): if 'new_frr_config' in mroute: frr_cfg.add_before(frr.default_add_before, mroute['new_frr_config']) - frr_cfg.commit_configuration(static_daemon) - + frr_cfg.commit_configuration() return None diff --git a/src/conf_mode/service_snmp.py b/src/conf_mode/service_snmp.py index c9c0ed9a0..134662f85 100755 --- a/src/conf_mode/service_snmp.py +++ b/src/conf_mode/service_snmp.py @@ -34,6 +34,7 @@ from vyos.utils.process import call from vyos.utils.permission import chmod_755 from vyos.version import get_version_data from vyos import ConfigError +from vyos import frr from vyos import airbag airbag.enable() @@ -265,7 +266,8 @@ def apply(snmp): # This should be done for each daemon individually because common command # works only if all the daemons started with SNMP support # Following daemons from FRR 9.0/stable have SNMP module compiled in VyOS - frr_daemons_list = ['zebra', 'bgpd', 'ospf6d', 'ospfd', 'ripd', 'isisd', 'ldpd'] + frr_daemons_list = [frr.zebra_daemon, frr.bgp_daemon, frr.ospf_daemon, frr.ospf6_daemon, + frr.rip_daemon, frr.isis_daemon, frr.ldpd_daemon] for frr_daemon in frr_daemons_list: call(f'vtysh -c "configure terminal" -d {frr_daemon} -c "agentx" >/dev/null') diff --git a/src/conf_mode/system_ip.py b/src/conf_mode/system_ip.py index c8a91fd2f..5afb57404 100755 --- a/src/conf_mode/system_ip.py +++ b/src/conf_mode/system_ip.py @@ -121,17 +121,16 @@ def apply(opt): # running when this script is called first. Skip this part and wait for initial # commit of the configuration to trigger this statement if is_systemd_service_active('frr.service'): - zebra_daemon = 'zebra' # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() # The route-map used for the FIB (zebra) is part of the zebra daemon - frr_cfg.load_configuration(zebra_daemon) + frr_cfg.load_configuration(frr.mgmt_daemon) frr_cfg.modify_section(r'no ip nht resolve-via-default') frr_cfg.modify_section(r'ip protocol \w+ route-map [-a-zA-Z0-9.]+', stop_pattern='(\s|!)') if 'frr_zebra_config' in opt: frr_cfg.add_before(frr.default_add_before, opt['frr_zebra_config']) - frr_cfg.commit_configuration(zebra_daemon) + frr_cfg.commit_configuration() call_dependents() diff --git a/src/conf_mode/system_ipv6.py b/src/conf_mode/system_ipv6.py index a2442d009..90d5100d7 100755 --- a/src/conf_mode/system_ipv6.py +++ b/src/conf_mode/system_ipv6.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2019-2023 VyOS maintainers and contributors +# Copyright (C) 2019-2024 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -105,17 +105,14 @@ def apply(opt): # running when this script is called first. Skip this part and wait for initial # commit of the configuration to trigger this statement if is_systemd_service_active('frr.service'): - zebra_daemon = 'zebra' # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - - # The route-map used for the FIB (zebra) is part of the zebra daemon - frr_cfg.load_configuration(zebra_daemon) + frr_cfg.load_configuration(frr.mgmt_daemon) frr_cfg.modify_section(r'no ipv6 nht resolve-via-default') frr_cfg.modify_section(r'ipv6 protocol \w+ route-map [-a-zA-Z0-9.]+', stop_pattern='(\s|!)') if 'frr_zebra_config' in opt: frr_cfg.add_before(frr.default_add_before, opt['frr_zebra_config']) - frr_cfg.commit_configuration(zebra_daemon) + frr_cfg.commit_configuration() call_dependents() diff --git a/src/conf_mode/vrf.py b/src/conf_mode/vrf.py index 72b178c89..6d17c192c 100755 --- a/src/conf_mode/vrf.py +++ b/src/conf_mode/vrf.py @@ -339,17 +339,13 @@ def apply(vrf): if has_rule(afi, 2000, 'l3mdev'): call(f'ip {afi} rule del pref 2000 l3mdev unreachable') - # Apply FRR filters - zebra_daemon = 'zebra' # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - - # The route-map used for the FIB (zebra) is part of the zebra daemon - frr_cfg.load_configuration(zebra_daemon) + frr_cfg.load_configuration(frr.mgmt_daemon) frr_cfg.modify_section(f'^vrf .+', stop_pattern='^exit-vrf', remove_stop_mark=True) if 'frr_zebra_config' in vrf: frr_cfg.add_before(frr.default_add_before, vrf['frr_zebra_config']) - frr_cfg.commit_configuration(zebra_daemon) + frr_cfg.commit_configuration() return None |