From 779f4001a4828f1af39a5b0b861d62635fcb3726 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Fri, 9 Dec 2022 16:08:57 -0600 Subject: openvpn: T4872: fix parsing of tunnel IP in 'show openvpn server' --- src/op_mode/show_openvpn.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/op_mode/show_openvpn.py b/src/op_mode/show_openvpn.py index 9a5adcffb..e29e594a5 100755 --- a/src/op_mode/show_openvpn.py +++ b/src/op_mode/show_openvpn.py @@ -59,7 +59,11 @@ def get_vpn_tunnel_address(peer, interface): for line in lines: if peer in line: lst.append(line) - tunnel_ip = lst[1].split(',')[0] + + # filter out subnet entries + lst = [l for l in lst[1:] if '/' not in l.split(',')[0]] + + tunnel_ip = lst[0].split(',')[0] return tunnel_ip -- cgit v1.2.3