diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-11-27 19:34:07 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-11-27 19:34:07 +0100 |
commit | 5e38895c906f05ecd3815573f07106a9ccab145a (patch) | |
tree | 8ae4ca088ae3646720422e84f7b46b0ac0c6a36b | |
parent | 3800ea910a72a4d1a78b63f235980d9414747816 (diff) | |
download | vyos-1x-5e38895c906f05ecd3815573f07106a9ccab145a.tar.gz vyos-1x-5e38895c906f05ecd3815573f07106a9ccab145a.zip |
frr: alwaws try to commit connfig 5 times
As a result to some frr-reload bugs workarounded in commit 3800ea91 or fe0038c2
this commit adds the workaround in general.
-rw-r--r-- | python/vyos/frr.py | 20 | ||||
-rwxr-xr-x | src/conf_mode/protocols_isis.py | 10 | ||||
-rwxr-xr-x | src/conf_mode/protocols_ospfv3.py | 10 | ||||
-rwxr-xr-x | src/conf_mode/protocols_rpki.py | 3 |
4 files changed, 17 insertions, 26 deletions
diff --git a/python/vyos/frr.py b/python/vyos/frr.py index 119ea8b50..7bad2b0b6 100644 --- a/python/vyos/frr.py +++ b/python/vyos/frr.py @@ -216,13 +216,8 @@ def reload_configuration(config, daemon=None): def save_configuration(): - """Save FRR configuration to /run/frr/config/frr.conf - It save configuration on each commit. T3217 - """ - - cmd(f'{path_vtysh} -n -w') - - return + """ T3217: Save FRR configuration to /run/frr/config/frr.conf """ + return cmd(f'{path_vtysh} -n -w') def execute(command): @@ -457,7 +452,16 @@ class FRRConfig: LOG.debug('commit_configuration: Commiting configuration') for i, e in enumerate(self.config): LOG.debug(f'commit_configuration: new_config {i:3} {e}') - reload_configuration('\n'.join(self.config), daemon=daemon) + + # https://github.com/FRRouting/frr/issues/10132 + # https://github.com/FRRouting/frr/issues/10133 + count = 0 + while count <= 5: + count += 1 + try: + reload_configuration('\n'.join(self.config), daemon=daemon) + except: + pass def modify_section(self, start_pattern, replacement='!', stop_pattern=r'\S+', remove_stop_mark=False, count=0): if isinstance(replacement, str): diff --git a/src/conf_mode/protocols_isis.py b/src/conf_mode/protocols_isis.py index 5d02de869..0011e6fbf 100755 --- a/src/conf_mode/protocols_isis.py +++ b/src/conf_mode/protocols_isis.py @@ -235,15 +235,7 @@ def apply(isis): if 'frr_isisd_config' in isis: frr_cfg.add_before(frr.default_add_before, isis['frr_isisd_config']) - # https://github.com/FRRouting/frr/issues/XXXX - count = 0 - while count <= 5: - count += 1 - try: - frr_cfg.commit_configuration(isis_daemon) - except: - pass - + frr_cfg.commit_configuration(isis_daemon) # Save configuration to /run/frr/config/frr.conf frr.save_configuration() diff --git a/src/conf_mode/protocols_ospfv3.py b/src/conf_mode/protocols_ospfv3.py index 77d9e0366..5d6ca7169 100755 --- a/src/conf_mode/protocols_ospfv3.py +++ b/src/conf_mode/protocols_ospfv3.py @@ -101,15 +101,7 @@ def apply(ospfv3): if 'new_frr_config' in ospfv3: frr_cfg.add_before(frr.default_add_before, ospfv3['new_frr_config']) - # https://github.com/FRRouting/frr/issues/10132 - count = 0 - while count <= 5: - count += 1 - try: - frr_cfg.commit_configuration(ospf6_daemon) - except: - pass - + frr_cfg.commit_configuration(ospf6_daemon) # Save configuration to /run/frr/config/frr.conf frr.save_configuration() diff --git a/src/conf_mode/protocols_rpki.py b/src/conf_mode/protocols_rpki.py index 41ce1f1fd..dadd8d6f4 100755 --- a/src/conf_mode/protocols_rpki.py +++ b/src/conf_mode/protocols_rpki.py @@ -93,7 +93,10 @@ def apply(rpki): frr_cfg.modify_section('^rpki') if 'new_frr_config' in rpki: frr_cfg.add_before(frr.default_add_before, rpki['new_frr_config']) + frr_cfg.commit_configuration(bgp_daemon) + # Save configuration to /run/frr/config/frr.conf + frr.save_configuration() return None |