summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/manager.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2017-02-04 17:01:25 +0100
committerKali Kaneko (leap communications) <kali@leap.se>2017-02-23 00:40:37 +0100
commit701fe5ebc70fb49bb32e81e6d6605f27ad09925b (patch)
tree0763df29131f3abe4604fc3626f51ed4360b5ff1 /src/leap/bitmask/vpn/manager.py
parent409a4c663ec3c0b4a394fcaa6d4b1c6b527f8522 (diff)
[feature] parse status
- simple status parsing - add separate firewall status - set status for abnormal termination
Diffstat (limited to 'src/leap/bitmask/vpn/manager.py')
-rw-r--r--src/leap/bitmask/vpn/manager.py33
1 files changed, 6 insertions, 27 deletions
diff --git a/src/leap/bitmask/vpn/manager.py b/src/leap/bitmask/vpn/manager.py
index a27789c3..04e88097 100644
--- a/src/leap/bitmask/vpn/manager.py
+++ b/src/leap/bitmask/vpn/manager.py
@@ -33,8 +33,7 @@ from .constants import IS_WIN
class VPNManager(object):
- def __init__(self, remotes, cert_path, key_path, ca_path, extra_flags,
- mock_signaler):
+ def __init__(self, remotes, cert_path, key_path, ca_path, extra_flags):
"""
Initialize the VPNManager object.
@@ -51,8 +50,7 @@ class VPNManager(object):
self._eipconfig = _TempEIPConfig(extra_flags, cert_path, ports)
self._providerconfig = _TempProviderConfig(domain, ca_path)
- signaler = None # XXX handle signaling somehow...
- self._vpn = VPNControl(remotes=remotes, signaler=signaler)
+ self._vpn = VPNControl(remotes=remotes)
def start(self):
@@ -82,34 +80,15 @@ class VPNManager(object):
:returns: True if succeeded, False otherwise.
:rtype: bool
"""
- self._vpn.terminate(False, False) # TODO review params
-
# TODO how to return False if this fails
+ self._vpn.stop(False, False) # TODO review params
return True
- def is_up(self):
- """
- Return whether the VPN is up or not.
-
- :rtype: bool
- """
- pass
-
- def kill(self):
- """
- Sends a kill signal to the openvpn process.
- """
- pass
- # self._vpn.killit()
- def terminate(self):
- """
- Stop the openvpn subprocess.
+ @property
+ def status(self):
+ return self._vpn.status
- Attempts to send a SIGTERM first, and after a timeout it sends a
- SIGKILL.
- """
- pass
def _get_management_location(self):
"""