diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2025-06-12 19:55:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-12 19:55:46 +0300 |
commit | 80652326e6e5f9d193ead77e0bee62f981e79301 (patch) | |
tree | ad7abe8b926ce550331ee0d17a476d1f5825e7c2 /python | |
parent | dcba87b2394b789c335b44856a8ae7bfea05353c (diff) | |
parent | 2ef19495e1a2750330a5a520f41601202ca2b703 (diff) | |
download | vyos-1x-80652326e6e5f9d193ead77e0bee62f981e79301.tar.gz vyos-1x-80652326e6e5f9d193ead77e0bee62f981e79301.zip |
Merge pull request #4552 from jestabro/reset-section
T7488: add utility for automatic rollback of section on apply stage error
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 = ( |