summaryrefslogtreecommitdiff
path: root/src/conf_mode/system_config-management.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-10-02 12:36:41 -0500
committerJohn Estabrook <jestabro@vyos.io>2024-10-05 00:27:19 -0500
commit4d5f2a58bbf5a366c43871ef27b75d31b3b2a114 (patch)
treecb3047407f14d724b0556df3040007629cee3459 /src/conf_mode/system_config-management.py
parentf9c81b121b146fbcf3c458273b2b47e6e571f2e2 (diff)
downloadvyos-1x-4d5f2a58bbf5a366c43871ef27b75d31b3b2a114.tar.gz
vyos-1x-4d5f2a58bbf5a366c43871ef27b75d31b3b2a114.zip
config-mgmt: T5976: add option for commit-confirm to use 'soft' rollback
Commit-confirm will restore a previous configuration if a confirmation is not received in N minutes. Traditionally, this was restored by a reboot into the last configuration on disk; add a configurable option to reload the last completed commit without a reboot. The default setting is to reboot.
Diffstat (limited to 'src/conf_mode/system_config-management.py')
-rwxr-xr-xsrc/conf_mode/system_config-management.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/conf_mode/system_config-management.py b/src/conf_mode/system_config-management.py
index 99f25bef6..a1ee136cd 100755
--- a/src/conf_mode/system_config-management.py
+++ b/src/conf_mode/system_config-management.py
@@ -38,7 +38,11 @@ def get_config(config=None):
return mgmt
-def verify(_mgmt):
+def verify(mgmt):
+ d = mgmt.config_dict
+ if d.get('commit_confirm', '') == 'reload' and 'commit_revisions' not in d:
+ raise ConfigError('commit-confirm reload requires non-zero commit-revisions')
+
return