From 4d5f2a58bbf5a366c43871ef27b75d31b3b2a114 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 2 Oct 2024 12:36:41 -0500 Subject: 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. --- .../system_config-management.xml.in | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'interface-definitions') diff --git a/interface-definitions/system_config-management.xml.in b/interface-definitions/system_config-management.xml.in index e666633b7..b8fb6cdb5 100644 --- a/interface-definitions/system_config-management.xml.in +++ b/interface-definitions/system_config-management.xml.in @@ -67,6 +67,26 @@ Number of revisions must be between 0 and 65535 + + + Commit confirm rollback type if no confirmation + + reload reboot + + + reload + Reload previous configuration if not confirmed + + + reboot + Reboot to saved configuration if not confirmed + + + (reload|reboot) + + + reboot + -- cgit v1.2.3 From 64196ec5fd90a8caedef88edb9068a32e4e6abfa Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Mon, 7 Oct 2024 12:15:44 -0500 Subject: config-mgmt: T5976: move commit-confirm revert action to subnode --- .../system_config-management.xml.in | 43 +++++++++++++--------- src/conf_mode/system_config-management.py | 3 +- 2 files changed, 27 insertions(+), 19 deletions(-) (limited to 'interface-definitions') diff --git a/interface-definitions/system_config-management.xml.in b/interface-definitions/system_config-management.xml.in index b8fb6cdb5..a23d44aea 100644 --- a/interface-definitions/system_config-management.xml.in +++ b/interface-definitions/system_config-management.xml.in @@ -67,26 +67,33 @@ Number of revisions must be between 0 and 65535 - + - Commit confirm rollback type if no confirmation - - reload reboot - - - reload - Reload previous configuration if not confirmed - - - reboot - Reboot to saved configuration if not confirmed - - - (reload|reboot) - + Commit confirm options - reboot - + + + + Commit confirm revert action + + reload reboot + + + reload + Reload previous configuration if not confirmed + + + reboot + Reboot to saved configuration if not confirmed + + + (reload|reboot) + + + reboot + + + diff --git a/src/conf_mode/system_config-management.py b/src/conf_mode/system_config-management.py index a1ee136cd..8de4e5342 100755 --- a/src/conf_mode/system_config-management.py +++ b/src/conf_mode/system_config-management.py @@ -40,7 +40,8 @@ def get_config(config=None): def verify(mgmt): d = mgmt.config_dict - if d.get('commit_confirm', '') == 'reload' and 'commit_revisions' not in d: + confirm = d.get('commit_confirm', {}) + if confirm.get('action', '') == 'reload' and 'commit_revisions' not in d: raise ConfigError('commit-confirm reload requires non-zero commit-revisions') return -- cgit v1.2.3