diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2017-02-01 14:49:45 +0100 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2017-02-23 00:40:31 +0100 |
commit | 1d4a3d68869dd9c416b104399097a6bb0c1bace3 (patch) | |
tree | 9afc38280e17a84e55184f064cf34f1a490ac539 /src/leap/bitmask/core | |
parent | 6d1d18faec5caa60c26b8245f0ab17c63d0b80d8 (diff) |
[feature] new commands: get_cert
Diffstat (limited to 'src/leap/bitmask/core')
-rw-r--r-- | src/leap/bitmask/core/dispatcher.py | 21 | ||||
-rw-r--r-- | src/leap/bitmask/core/service.py | 2 |
2 files changed, 19 insertions, 4 deletions
diff --git a/src/leap/bitmask/core/dispatcher.py b/src/leap/bitmask/core/dispatcher.py index 833741dd..a93c3ec5 100644 --- a/src/leap/bitmask/core/dispatcher.py +++ b/src/leap/bitmask/core/dispatcher.py @@ -201,12 +201,27 @@ class EIPCmd(SubCommand): except IndexError: raise DispatchError( 'wrong number of arguments: expected 1, got none') - d = eip.do_start(provider) + # TODO --- attempt to get active provider + # TODO or catch the exception and send error + provider = parts[2] + d = eip.start_vpn(provider) return d @register_method('dict') def do_STOP(self, eip, *parts): - d = eip.do_stop() + d = eip.stop_vpn() + return d + + @register_method('check') + def do_CHECK(self, eip, *parts): + d = eip.do_check() + return d + + @register_method('get_cert') + def do_GET_CERT(self, eip, *parts): + # TODO -- attempt to get active provider + provider = parts[2] + d = eip.do_get_cert(provider) return d @@ -513,7 +528,7 @@ def _format_error(failure): logger.failure('[DISPATCHER] Unexpected error:') except: logger.debug('[DISPATCHER] Unexpected error: %r' % failure.value) - logger.debug('%r' % failure) + print failure.getTraceback() # if needed, we could add here the exception type as an extra field return json.dumps({'error': failure.value.message, 'result': None}) diff --git a/src/leap/bitmask/core/service.py b/src/leap/bitmask/core/service.py index 3a3b1f69..65b5ddcc 100644 --- a/src/leap/bitmask/core/service.py +++ b/src/leap/bitmask/core/service.py @@ -32,7 +32,7 @@ from leap.bitmask.core import _zmq from leap.bitmask.core import flags from leap.bitmask.core import _session from leap.bitmask.core.web.service import HTTPDispatcherService -from leap.bitmask.vpn import EIPService +from leap.bitmask.vpn.service import EIPService from leap.common.events import server as event_server logger = Logger() |