diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2017-02-04 17:01:25 +0100 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2017-02-23 00:40:37 +0100 |
commit | 701fe5ebc70fb49bb32e81e6d6605f27ad09925b (patch) | |
tree | 0763df29131f3abe4604fc3626f51ed4360b5ff1 /src/leap/bitmask/vpn/eip.py | |
parent | 409a4c663ec3c0b4a394fcaa6d4b1c6b527f8522 (diff) |
[feature] parse status
- simple status parsing
- add separate firewall status
- set status for abnormal termination
Diffstat (limited to 'src/leap/bitmask/vpn/eip.py')
-rw-r--r-- | src/leap/bitmask/vpn/eip.py | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/leap/bitmask/vpn/eip.py b/src/leap/bitmask/vpn/eip.py index b080aa65..c2aa4fb3 100644 --- a/src/leap/bitmask/vpn/eip.py +++ b/src/leap/bitmask/vpn/eip.py @@ -20,19 +20,15 @@ from colorama import Fore from leap.bitmask.vpn.manager import VPNManager from leap.bitmask.vpn.fw.firewall import FirewallManager -from leap.bitmask.vpn.status import StatusQueue -from leap.bitmask.vpn.zmq_pub import ZMQPublisher class EIPManager(object): def __init__(self, remotes, cert, key, ca, flags): + self._vpn = VPNManager( + remotes, cert, key, ca, flags) self._firewall = FirewallManager(remotes) - self._status_queue = StatusQueue() - self._pub = ZMQPublisher(self._status_queue) - self._vpn = VPNManager(remotes, cert, key, ca, flags, - self._status_queue) def start(self): """ @@ -40,7 +36,6 @@ class EIPManager(object): This may raise exceptions, see errors.py """ - # self._pub.start() print(Fore.BLUE + "Firewall: starting..." + Fore.RESET) fw_ok = self._firewall.start() if not fw_ok: @@ -59,10 +54,6 @@ class EIPManager(object): print(Fore.GREEN + "VPN: started" + Fore.RESET) def stop(self): - """ - Stop EIP service - """ - # self._pub.stop() print(Fore.BLUE + "Firewall: stopping..." + Fore.RESET) fw_ok = self._firewall.stop() @@ -81,8 +72,10 @@ class EIPManager(object): print(Fore.GREEN + "VPN: stopped." + Fore.RESET) return True - def get_state(self): - pass - def get_status(self): - pass + vpn_status = self._vpn.status + fw_status = self._firewall.status + result = {'EIP': vpn_status, + 'firewall': fw_status} + return result + |