summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-11-27 20:10:55 +0100
committerChristian Poessinger <christian@poessinger.com>2021-11-27 20:10:55 +0100
commitf1973bcf16fcc5e38c5fa3d3749846470e8e4afa (patch)
tree182962a93fcf44b3d7b638a40c1cad4cb7b89168 /python
parentda6d56c37d3e571d72ef3fe226b5ce38ba9f1222 (diff)
downloadvyos-1x-f1973bcf16fcc5e38c5fa3d3749846470e8e4afa.tar.gz
vyos-1x-f1973bcf16fcc5e38c5fa3d3749846470e8e4afa.zip
frr: T3753: autosave config when calling commit_configuration()
Diffstat (limited to 'python')
-rw-r--r--python/vyos/frr.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/python/vyos/frr.py b/python/vyos/frr.py
index e5253350a..a8f115d9a 100644
--- a/python/vyos/frr.py
+++ b/python/vyos/frr.py
@@ -445,9 +445,11 @@ class FRRConfig:
mark_configuration('\n'.join(self.config))
def commit_configuration(self, daemon=None):
- '''Commit the current configuration to FRR
- daemon: str with name of the FRR daemon to commit to or
- None to use the consolidated config
+ '''
+ Commit the current configuration to FRR daemon: str with name of the
+ FRR daemon to commit to or None to use the consolidated config.
+
+ Configuration is automatically saved after apply
'''
LOG.debug('commit_configuration: Commiting configuration')
for i, e in enumerate(self.config):
@@ -469,6 +471,9 @@ class FRRConfig:
if count >= count_max:
raise ConfigurationNotValid(f'Config commit retry counter ({count_max}) exceeded')
+ # Save configuration to /run/frr/config/frr.conf
+ save_configuration()
+
def modify_section(self, start_pattern, replacement='!', stop_pattern=r'\S+', remove_stop_mark=False, count=0):
if isinstance(replacement, str):