From 0686808c07e758bb3aa6d82d2482d4d972d83d71 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 17 Apr 2025 23:48:49 -0500 Subject: T7374: add teardown session util to be called on CLI config session exit --- src/helpers/teardown-config-session.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 src/helpers/teardown-config-session.py (limited to 'src/helpers/teardown-config-session.py') diff --git a/src/helpers/teardown-config-session.py b/src/helpers/teardown-config-session.py new file mode 100755 index 000000000..c94876924 --- /dev/null +++ b/src/helpers/teardown-config-session.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2025 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# + +import sys +import os + +from vyos.vyconf_session import VyconfSession + +if len(sys.argv) < 2: + sys.exit('session pid is required') + +pid = sys.argv[1] + +vc = VyconfSession(pid=pid) +vc.teardown() -- cgit v1.2.3