diff options
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() |