summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-11-27 20:10:19 +0100
committerChristian Poessinger <christian@poessinger.com>2021-11-27 20:10:19 +0100
commitda6d56c37d3e571d72ef3fe226b5ce38ba9f1222 (patch)
tree79396701508c2661a9869ce2197d0286de071c60 /python
parent59dc14bee7ca6e4fd2bbabe5c5ae7518839e7a80 (diff)
downloadvyos-1x-da6d56c37d3e571d72ef3fe226b5ce38ba9f1222.tar.gz
vyos-1x-da6d56c37d3e571d72ef3fe226b5ce38ba9f1222.zip
frr: T3753: raise ConfigurationNotValid if commit loop counter is exceeded
Diffstat (limited to 'python')
-rw-r--r--python/vyos/frr.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/python/vyos/frr.py b/python/vyos/frr.py
index 7bad2b0b6..e5253350a 100644
--- a/python/vyos/frr.py
+++ b/python/vyos/frr.py
@@ -456,12 +456,19 @@ class FRRConfig:
# https://github.com/FRRouting/frr/issues/10132
# https://github.com/FRRouting/frr/issues/10133
count = 0
- while count <= 5:
+ count_max = 5
+ while count < count_max:
count += 1
try:
reload_configuration('\n'.join(self.config), daemon=daemon)
+ break
except:
+ # we just need to re-try the commit of the configuration
+ # for the listed FRR issues above
pass
+ if count >= count_max:
+ raise ConfigurationNotValid(f'Config commit retry counter ({count_max}) exceeded')
+
def modify_section(self, start_pattern, replacement='!', stop_pattern=r'\S+', remove_stop_mark=False, count=0):
if isinstance(replacement, str):