diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-11-27 20:10:55 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-11-27 20:10:55 +0100 |
commit | f1973bcf16fcc5e38c5fa3d3749846470e8e4afa (patch) | |
tree | 182962a93fcf44b3d7b638a40c1cad4cb7b89168 /python/vyos/frr.py | |
parent | da6d56c37d3e571d72ef3fe226b5ce38ba9f1222 (diff) | |
download | vyos-1x-f1973bcf16fcc5e38c5fa3d3749846470e8e4afa.tar.gz vyos-1x-f1973bcf16fcc5e38c5fa3d3749846470e8e4afa.zip |
frr: T3753: autosave config when calling commit_configuration()
Diffstat (limited to 'python/vyos/frr.py')
-rw-r--r-- | python/vyos/frr.py | 11 |
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): |