summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/service.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2017-09-10 20:47:11 +0200
committerKali Kaneko <kali@leap.se>2017-09-10 22:11:32 +0200
commit0331bcc09c5fb602366c93ee35c95a2e320b78bd (patch)
treecfb6e178cca7a0314c3151a3da58c0664c1fbed9 /src/leap/bitmask/vpn/service.py
parentafff83e87bb7322c9d01f71b8b12dbdc7f9d6ffe (diff)
[bug] mark vpn as failed if it had some problem starting
Diffstat (limited to 'src/leap/bitmask/vpn/service.py')
-rw-r--r--src/leap/bitmask/vpn/service.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/leap/bitmask/vpn/service.py b/src/leap/bitmask/vpn/service.py
index c410f7e..c9e1890 100644
--- a/src/leap/bitmask/vpn/service.py
+++ b/src/leap/bitmask/vpn/service.py
@@ -112,7 +112,7 @@ class VPNService(HookableService):
raise Exception('Could not start firewall')
try:
- self._tunnel.start()
+ result = yield self._tunnel.start()
except Exception as exc:
self._firewall.stop()
# TODO get message from exception
@@ -120,7 +120,12 @@ class VPNService(HookableService):
self._domain = domain
self._write_last(domain)
- defer.returnValue({'result': 'started'})
+ if result is True:
+ data = {'result': 'started'}
+ else:
+ data = {'result': 'failed', 'error': '%r' % result}
+
+ defer.returnValue(data)
def stop_vpn(self):
if self._firewall.is_up():