diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2024-01-25 19:37:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-25 19:37:18 +0200 |
commit | bda7df42d2d7bcdb1c00610a9bfc02c22cd9a3d1 (patch) | |
tree | ddc731f8052c018e03f442554f46f859f33a9416 /src | |
parent | 4276133800e9aa5d5fb5a17faad77b185a68c7c3 (diff) | |
parent | 4fe6f26a58e63b1d370aef1db5ba5f6b67587d5b (diff) | |
download | vyos-1x-bda7df42d2d7bcdb1c00610a9bfc02c22cd9a3d1.tar.gz vyos-1x-bda7df42d2d7bcdb1c00610a9bfc02c22cd9a3d1.zip |
Merge pull request #2895 from vyos/mergify/bp/sagitta/pr-2619
T5817: Fix for show openvpn server (backport #2619)
Diffstat (limited to 'src')
-rwxr-xr-x | src/op_mode/show_openvpn.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/op_mode/show_openvpn.py b/src/op_mode/show_openvpn.py index e29e594a5..6abafc8b6 100755 --- a/src/op_mode/show_openvpn.py +++ b/src/op_mode/show_openvpn.py @@ -63,9 +63,11 @@ def get_vpn_tunnel_address(peer, interface): # filter out subnet entries lst = [l for l in lst[1:] if '/' not in l.split(',')[0]] - tunnel_ip = lst[0].split(',')[0] + if lst: + tunnel_ip = lst[0].split(',')[0] + return tunnel_ip - return tunnel_ip + return 'n/a' def get_status(mode, interface): status_file = '/var/run/openvpn/{}.status'.format(interface) |