From f1973bcf16fcc5e38c5fa3d3749846470e8e4afa Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 27 Nov 2021 20:10:55 +0100 Subject: frr: T3753: autosave config when calling commit_configuration() --- python/vyos/frr.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'python') 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): -- cgit v1.2.3