summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-03-28 20:03:52 +0100
committerGitHub <noreply@github.com>2024-03-28 20:03:52 +0100
commit4412edb14062cc53ede8ac6edbc584596d8abd47 (patch)
treeab93037ae1aa9495de34b6738ed96a739aa99dae /src
parent18a39bb1cb0044f4b272d66bd0defb5d5dbc7e77 (diff)
parent66a009f367f8bf274eac9a4d4e1f4f8911c85872 (diff)
downloadvyos-1x-4412edb14062cc53ede8ac6edbc584596d8abd47.tar.gz
vyos-1x-4412edb14062cc53ede8ac6edbc584596d8abd47.zip
Merge pull request #3198 from HollyGurza/T6159
openvpn: T6159: Openvpn Server Op-cmd adds heading "OpenVPN status on vtunx" for every client connection
Diffstat (limited to 'src')
-rwxr-xr-xsrc/op_mode/openvpn.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/op_mode/openvpn.py b/src/op_mode/openvpn.py
index fd9d2db92..d54a67199 100755
--- a/src/op_mode/openvpn.py
+++ b/src/op_mode/openvpn.py
@@ -205,11 +205,11 @@ def _format_openvpn(data: list) -> str:
intf = d['intf']
l_host = d['local_host']
l_port = d['local_port']
+ out += f'\nOpenVPN status on {intf}\n\n'
for client in d['clients']:
r_host = client['remote_host']
r_port = client['remote_port']
- out += f'\nOpenVPN status on {intf}\n\n'
name = client['name']
remote = r_host + ':' + r_port if r_host and r_port else 'N/A'
tunnel = client['tunnel']
@@ -220,9 +220,8 @@ def _format_openvpn(data: list) -> str:
data_out.append([name, remote, tunnel, local, tx_bytes,
rx_bytes, online_since])
- if data_out:
- out += tabulate(data_out, headers)
- out += "\n"
+ out += tabulate(data_out, headers)
+ out += "\n"
return out