This commit is contained in:
1 parent
90e7c79840
commit
609921348b
2 files changed
+10
No files matched your search
@@ -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
|
vpn-router (0.4.2-1) unstable; urgency=medium
|
||||||
|
|
||||||
* /config gives the IPsec connections and SAs as objects, read from
|
* /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
|
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
|
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.
|
"... 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')
|
result = run('swanctl', command, '--pretty')
|
||||||
if result is None or result.returncode != 0:
|
if result is None or result.returncode != 0:
|
||||||
@@ -102,6 +103,8 @@ def swanctl(command):
|
|||||||
if not line:
|
if not line:
|
||||||
continue
|
continue
|
||||||
if line in ('}', ']'):
|
if line in ('}', ']'):
|
||||||
|
if not stack:
|
||||||
|
return None
|
||||||
stack.pop()
|
stack.pop()
|
||||||
elif not stack:
|
elif not stack:
|
||||||
section = {}
|
section = {}
|
||||||
|
|||||||
Reference in new issue
Block a user