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

@@ -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 = {}