summaryrefslogtreecommitdiff
path: root/python/vyos/configsession.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 /python/vyos/configsession.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 'python/vyos/configsession.py')
-rw-r--r--python/vyos/configsession.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/vyos/configsession.py b/python/vyos/configsession.py
index c0d3c7ecb..9c56d246a 100644
--- a/python/vyos/configsession.py
+++ b/python/vyos/configsession.py
@@ -268,6 +268,15 @@ class ConfigSession(object):
out = self.__run_command(LOAD_CONFIG + [file_path])
return out
+ def load_explicit(self, file_path):
+ from vyos.load_config import load
+ from vyos.load_config import LoadConfigError
+
+ try:
+ load(file_path, switch='explicit')
+ except LoadConfigError as e:
+ raise ConfigSessionError(e) from e
+
def migrate_and_load_config(self, file_path):
out = self.__run_command(MIGRATE_LOAD_CONFIG + [file_path])
return out