From 7953bd1844235bf12ab82c030194c7a78c2b3b28 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Sun, 10 Sep 2017 21:08:37 +0200 Subject: [bug] avoid bogus failed status there was an exception catched, AttributeError, that showed up as a transient "failed" state. - Resolves: #9044 --- src/leap/bitmask/vpn/process.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/leap/bitmask/vpn/process.py') diff --git a/src/leap/bitmask/vpn/process.py b/src/leap/bitmask/vpn/process.py index 93e73d9..7f33e83 100644 --- a/src/leap/bitmask/vpn/process.py +++ b/src/leap/bitmask/vpn/process.py @@ -102,6 +102,7 @@ class _VPNProcess(protocol.ProcessProtocol): self._providerconfig = providerconfig self._launcher = get_vpn_launcher() self._restartfun = restartfun + self._status = 'off' self.restarting = True self.failed = False @@ -215,8 +216,13 @@ class _VPNProcess(protocol.ProcessProtocol): if not self.proto: return {'status': 'off', 'error': None} - status = {'status': self.proto.state.simple.lower(), - 'error': None} + try: + self._status = self.proto.state.simple.lower() + status = {'status': self._status, 'error': None} + except AttributeError: + # glitch due to proto.state transition? + status = {'status': self._status, 'error': None} + if self.proto.traffic: remote = self.proto.remote rport = self.proto.rport -- cgit v1.2.3