summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/tunnel.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2017-06-15 09:24:03 -0700
committerKali Kaneko (leap communications) <kali@leap.se>2017-06-16 19:22:26 +0200
commit91b001b65f6974897fb0d7fd13991facd8227c47 (patch)
tree64e389ba68037173f7937af4ffd380e1c684bd67 /src/leap/bitmask/vpn/tunnel.py
parentb3428331a04bc4d8843b4ef2d4a62eaf3f7beafe (diff)
[feat] fix OpenVPN start/stop in OSX using a process canary
- correctly start the openvpn process canary - use helper to fix tearing down of the vpn
Diffstat (limited to 'src/leap/bitmask/vpn/tunnel.py')
-rw-r--r--src/leap/bitmask/vpn/tunnel.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/leap/bitmask/vpn/tunnel.py b/src/leap/bitmask/vpn/tunnel.py
index 4236edf5..70b4be0e 100644
--- a/src/leap/bitmask/vpn/tunnel.py
+++ b/src/leap/bitmask/vpn/tunnel.py
@@ -34,6 +34,8 @@ from .constants import IS_WIN
# TODO DO NOT pass VPNConfig/ProviderConfig beyond this class.
# TODO split sync/async vpn control mechanisms.
+# TODO ConfiguredVPNConnection ?
+
class VPNTunnel(object):
@@ -63,16 +65,16 @@ class VPNTunnel(object):
host, port = self._get_management_location()
- self._vpn = VPNControl(remotes=remotes,
- vpnconfig=self._vpnconfig,
- providerconfig=self._providerconfig,
- socket_host=host, socket_port=port)
+ self._vpncontrol = VPNControl(
+ remotes=remotes, vpnconfig=self._vpnconfig,
+ providerconfig=self._providerconfig,
+ socket_host=host, socket_port=port)
def start(self):
"""
Start the VPN process.
"""
- result = self._vpn.start()
+ result = self._vpncontrol.start()
return result
def stop(self):
@@ -83,16 +85,16 @@ class VPNTunnel(object):
:rtype: bool
"""
# TODO how to return False if this fails
- result = self._vpn.stop(False, False) # TODO review params
+ result = self._vpncontrol.stop(False, False) # TODO review params
return result
@property
def status(self):
- return self._vpn.status
+ return self._vpncontrol.status
@property
def traffic_status(self):
- return self._vpn.traffic_status
+ return self._vpncontrol.traffic_status
def _get_management_location(self):
"""