From 4c391ed39c51172cbb8f2de6732d6fe4e3a8b125 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Tue, 21 Oct 2025 19:14:12 -0500 Subject: T7910: add keyword extant, for use by teardown script The standalone script teardown-config-session.py is called on CLI config-mode exit, to close the persistent vyconf config session. Instead of injecting the config-mode env var into the external script to indicate a non-ephemeral session, add keyword 'extant' to find existing session. --- src/helpers/teardown-config-session.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/helpers/teardown-config-session.py b/src/helpers/teardown-config-session.py index c30303c99..49a3f5bc5 100755 --- a/src/helpers/teardown-config-session.py +++ b/src/helpers/teardown-config-session.py @@ -23,5 +23,10 @@ if len(sys.argv) < 2: pid = sys.argv[1] -vc = VyconfSession(pid=pid) -vc.teardown() +try: + vc = VyconfSession(pid=int(pid), extant=True) +except ValueError: + # as this script is called on any config session exit, ignore non-existent + pass +else: + vc.teardown() -- cgit v1.2.3