diff options
author | John Estabrook <jestabro@vyos.io> | 2025-05-23 10:40:40 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2025-06-10 18:12:48 -0500 |
commit | 00cb7fd19587771129c9923a781488929c03f3f8 (patch) | |
tree | be600a1212df9ba14c8767b45660312a48ac8753 /python | |
parent | c82b2b836b01c285576cc98ecf2b99ff3d8838ef (diff) | |
download | vyos-1x-00cb7fd19587771129c9923a781488929c03f3f8.tar.gz vyos-1x-00cb7fd19587771129c9923a781488929c03f3f8.zip |
T7488: add utility for automatic rollback of section on apply stage err
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/configsession.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/python/vyos/configsession.py b/python/vyos/configsession.py index f0d636b89..7af2cb333 100644 --- a/python/vyos/configsession.py +++ b/python/vyos/configsession.py @@ -146,7 +146,7 @@ class ConfigSession(object): The write API of VyOS. """ - def __init__(self, session_id, app=APP): + def __init__(self, session_id, app=APP, shared=False): """ Creates a new config session. @@ -187,7 +187,11 @@ class ConfigSession(object): else: self._vyconf_session = None + self.shared = shared + def __del__(self): + if self.shared: + return if self._vyconf_session is None: try: output = ( |