fix: incorrect swanctl parsing.
Release / release (push) Successful in 18s

This commit is contained in:
slawek committed 2026-10-23 20:56:52 +02:00
1 parent 90e7c79840
commit 609921348b
2 files changed
+10

No files matched your search

+7
View File
@@ -1,3 +1,10 @@
vpn-router (0.4.3-1) unstable; urgency=medium
* swanctl output with more closing than opening lines is read as not
available instead of failing the request.
-- Slawomir Koszewski <slawek@koszewscy.waw.pl> Fri, 23 Oct 2026 22:00:00 +0200
vpn-router (0.4.2-1) unstable; urgency=medium
* /config gives the IPsec connections and SAs as objects, read from
@@ -91,6 +91,7 @@ def swanctl(command):
whose value may contain spaces. Every "... event {" section at the top holds one
connection or SA; each becomes an entry with its name under "name". The closing
"... reply {" section is left out. Values stay strings, as swanctl prints them.
Output with more closing than opening lines gives None.
"""
result = run('swanctl', command, '--pretty')
if result is None or result.returncode != 0:
@@ -102,6 +103,8 @@ def swanctl(command):
if not line:
continue
if line in ('}', ']'):
if not stack:
return None
stack.pop()
elif not stack:
section = {}