From 44227cfaa63446174d1305c2143cf676a576b759 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 12 Sep 2019 21:05:58 +0200 Subject: openvpn: T1548: fix missing sys import --- src/op_mode/show_openvpn.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/op_mode/show_openvpn.py') diff --git a/src/op_mode/show_openvpn.py b/src/op_mode/show_openvpn.py index 23a8156ec..eafb645de 100755 --- a/src/op_mode/show_openvpn.py +++ b/src/op_mode/show_openvpn.py @@ -18,6 +18,7 @@ import jinja2 import argparse +from sys import exit from vyos.config import Config outp_tmpl = """ @@ -136,7 +137,7 @@ if __name__ == '__main__': config = Config() if len(config.list_effective_nodes('interfaces openvpn')) == 0: print("No OpenVPN interfaces configured") - sys.exit(0) + exit(0) # search all OpenVPN interfaces and add those with a matching mode to our # interfaces list -- cgit v1.2.3 From 02195d0e54f09f57028966583b9068959c06a2af Mon Sep 17 00:00:00 2001 From: DmitriyEshenko Date: Sat, 14 Sep 2019 21:00:33 +0000 Subject: [openvpn] T1662 Defined default remote port if it not set in cli --- src/op_mode/show_openvpn.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/op_mode/show_openvpn.py') diff --git a/src/op_mode/show_openvpn.py b/src/op_mode/show_openvpn.py index eafb645de..577ed7eb7 100755 --- a/src/op_mode/show_openvpn.py +++ b/src/op_mode/show_openvpn.py @@ -162,6 +162,10 @@ if __name__ == '__main__': remote_host = config.return_effective_values('interfaces openvpn {} remote-host'.format(intf)) remote_port = config.return_effective_value('interfaces openvpn {} remote-port'.format(intf)) + + if not remote_port: + remote_port = '1194' + if len(remote_host) >= 1: client['remote'] = str(remote_host[0]) + ':' + remote_port -- cgit v1.2.3