From 701fe5ebc70fb49bb32e81e6d6605f27ad09925b Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Sat, 4 Feb 2017 17:01:25 +0100 Subject: [feature] parse status - simple status parsing - add separate firewall status - set status for abnormal termination --- src/leap/bitmask/vpn/manager.py | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) (limited to 'src/leap/bitmask/vpn/manager.py') 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): """ -- cgit v1.2.3