summaryrefslogtreecommitdiff
path: root/src/leap/services/eip/vpnlaunchers.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-08-06 02:45:41 +0200
committerKali Kaneko <kali@leap.se>2013-08-07 11:52:25 +0200
commit03ebed92556e965d5bc39b256e77cf9cf18fb11b (patch)
tree4b95e65095870743efed1213119a83c64240e4d9 /src/leap/services/eip/vpnlaunchers.py
parentd6bf9b3e11ff87488a5f508acebf8f20ad026166 (diff)
Allow to change openvpn verbosity in logs
Diffstat (limited to 'src/leap/services/eip/vpnlaunchers.py')
-rw-r--r--src/leap/services/eip/vpnlaunchers.py26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/leap/services/eip/vpnlaunchers.py b/src/leap/services/eip/vpnlaunchers.py
index 0151c1c6..95d95c0e 100644
--- a/src/leap/services/eip/vpnlaunchers.py
+++ b/src/leap/services/eip/vpnlaunchers.py
@@ -352,7 +352,7 @@ class LinuxVPNLauncher(VPNLauncher):
return None
def get_vpn_command(self, eipconfig=None, providerconfig=None,
- socket_host=None, socket_port="unix"):
+ socket_host=None, socket_port="unix", openvpn_verb=1):
"""
Returns the platform dependant vpn launching command. It will
look for openvpn in the regular paths and algo in
@@ -375,6 +375,9 @@ class LinuxVPNLauncher(VPNLauncher):
socket, or port otherwise
:type socket_port: str
+ :param openvpn_verb: openvpn verbosity wanted
+ :type openvpn_verb: int
+
:return: A VPN command ready to be launched
:rtype: list
"""
@@ -404,7 +407,7 @@ class LinuxVPNLauncher(VPNLauncher):
args.append(openvpn)
openvpn = first(pkexec)
- # TODO: handle verbosity
+ args += ['--verb', '%d' % (openvpn_verb,)]
gateway_selector = VPNGatewaySelector(eipconfig)
gateways = gateway_selector.get_gateways()
@@ -604,7 +607,7 @@ class DarwinVPNLauncher(VPNLauncher):
return self.COCOASUDO, args
def get_vpn_command(self, eipconfig=None, providerconfig=None,
- socket_host=None, socket_port="unix"):
+ socket_host=None, socket_port="unix", openvpn_verb=1):
"""
Returns the platform dependant vpn launching command
@@ -623,6 +626,9 @@ class DarwinVPNLauncher(VPNLauncher):
socket, or port otherwise
:type socket_port: str
+ :param openvpn_verb: openvpn verbosity wanted
+ :type openvpn_verb: int
+
:return: A VPN command ready to be launched
:rtype: list
"""
@@ -651,7 +657,7 @@ class DarwinVPNLauncher(VPNLauncher):
openvpn = first(openvpn_possibilities)
args = [openvpn]
- # TODO: handle verbosity
+ args += ['--verb', '%d' % (openvpn_verb,)]
gateway_selector = VPNGatewaySelector(eipconfig)
gateways = gateway_selector.get_gateways()
@@ -768,9 +774,10 @@ class WindowsVPNLauncher(VPNLauncher):
OPENVPN_BIN = 'openvpn_leap.exe'
# XXX UPDOWN_FILES ... we do not have updown files defined yet!
+ # (and maybe we won't)
def get_vpn_command(self, eipconfig=None, providerconfig=None,
- socket_host=None, socket_port="9876"):
+ socket_host=None, socket_port="9876", openvpn_verb=1):
"""
Returns the platform dependant vpn launching command. It will
look for openvpn in the regular paths and algo in
@@ -780,14 +787,20 @@ class WindowsVPNLauncher(VPNLauncher):
:param eipconfig: eip configuration object
:type eipconfig: EIPConfig
+
:param providerconfig: provider specific configuration
:type providerconfig: ProviderConfig
+
:param socket_host: either socket path (unix) or socket IP
:type socket_host: str
+
:param socket_port: either string "unix" if it's a unix
socket, or port otherwise
:type socket_port: str
+ :param openvpn_verb: the openvpn verbosity wanted
+ :type openvpn_verb: int
+
:return: A VPN command ready to be launched
:rtype: list
"""
@@ -810,8 +823,7 @@ class WindowsVPNLauncher(VPNLauncher):
openvpn = first(openvpn_possibilities)
args = []
-
- # TODO: handle verbosity
+ args += ['--verb', '%d' % (openvpn_verb,)]
gateway_selector = VPNGatewaySelector(eipconfig)
gateways = gateway_selector.get_gateways()