diff options
author | Christian Breunig <christian@breunig.cc> | 2023-02-28 07:23:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-28 07:23:45 +0100 |
commit | cfed824d7279fb8b3a4958957b5d7302cbf73f79 (patch) | |
tree | 1fc827646216e23dd4a4f2d8fb4b395dac795827 /src | |
parent | dfd88d01a7ed367bb693836bc71ce11a516f3261 (diff) | |
parent | 07d25556de4d2ec0f1946a724fe4a67933259261 (diff) | |
download | vyos-1x-cfed824d7279fb8b3a4958957b5d7302cbf73f79.tar.gz vyos-1x-cfed824d7279fb8b3a4958957b5d7302cbf73f79.zip |
Merge pull request #1858 from jestabro/typo-openvpn
openvpn: T4770: fix tabulate output in _format_openvpn
Diffstat (limited to 'src')
-rwxr-xr-x | src/op_mode/openvpn.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/op_mode/openvpn.py b/src/op_mode/openvpn.py index d957a1d01..79130c7c0 100755 --- a/src/op_mode/openvpn.py +++ b/src/op_mode/openvpn.py @@ -173,8 +173,8 @@ def _format_openvpn(data: dict) -> str: 'TX bytes', 'RX bytes', 'Connected Since'] out = '' - data_out = [] for intf in list(data): + data_out = [] l_host = data[intf]['local_host'] l_port = data[intf]['local_port'] for client in list(data[intf]['clients']): @@ -192,7 +192,9 @@ def _format_openvpn(data: dict) -> str: data_out.append([name, remote, tunnel, local, tx_bytes, rx_bytes, online_since]) - out += tabulate(data_out, headers) + if data_out: + out += tabulate(data_out, headers) + out += "\n" return out |