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/status.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/status.py')
-rw-r--r-- | src/leap/bitmask/vpn/status.py | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/leap/bitmask/vpn/status.py b/src/leap/bitmask/vpn/status.py deleted file mode 100644 index ff7f3111..00000000 --- a/src/leap/bitmask/vpn/status.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -Queue used to store status changes on EIP/VPN/Firewall and to be checked for -any app using this vpn library. - -This should be considered a temporary code meant to replace the signaling -system that announces events inside of vpn code and is catched on the bitmask -client. -""" - -import Queue - - -class StatusQueue(object): - def __init__(self): - self._status = Queue.Queue() - - # this attributes serve to simulate events in the old signaler used - self.eip_network_unreachable = "network_unreachable" - self.eip_process_restart_tls = "process_restart_tls" - self.eip_process_restart_ping = "process_restart_ping" - self.eip_connected = "initialization_completed" - self.eip_status_changed = "status_changed" # has parameter - self.eip_state_changed = "state_changed" # has parameter - self.eip_process_finished = "process_finished" # has parameter - - def get_noblock(self): - s = None - try: - s = self._status.get(False) - except Queue.Empty: - pass - - return s - - def get(self): - return self._status.get(timeout=1) - - def signal(self, status, data=None): - self._status.put({'status': status, 'data': data}) |