diff options
author | Kali Kaneko <kali@leap.se> | 2018-02-08 01:23:36 +0100 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2018-02-15 16:36:39 +0100 |
commit | 48257bd03d792188931f79b4239525725b322c09 (patch) | |
tree | 0ddee15c0ceebcde4bef7289b0669266e7b9febe | |
parent | 3aaa810ccb41bff27ab17130932840eefd49fb83 (diff) |
[bug] fail gracefully if we do not have mail deps
-rw-r--r-- | pkg/pyinst/anonvpn.spec | 2 | ||||
-rw-r--r-- | src/leap/bitmask/core/service.py | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/pkg/pyinst/anonvpn.spec b/pkg/pyinst/anonvpn.spec index 3f5e18da..0748fc09 100644 --- a/pkg/pyinst/anonvpn.spec +++ b/pkg/pyinst/anonvpn.spec @@ -31,7 +31,7 @@ a = Analysis(ENTRYPOINT, hiddenimports=hiddenimports, hookspath=[], runtime_hooks=[], - excludes=excludes, + excludes=[], win_no_prefer_redirects=False, win_private_assemblies=False, diff --git a/src/leap/bitmask/core/service.py b/src/leap/bitmask/core/service.py index 026e51d9..c3672843 100644 --- a/src/leap/bitmask/core/service.py +++ b/src/leap/bitmask/core/service.py @@ -46,7 +46,11 @@ except ImportError as exc: backend = flags.BACKEND if backend == 'default': - from leap.bitmask.core import mail_services + try: + from leap.bitmask.core import mail_services + HAS_MAIL = True + except ImportError: + HAS_MAIL = False from leap.bitmask.bonafide.service import BonafideService elif backend == 'dummy': from leap.bitmask.core.dummy import mail_services @@ -98,10 +102,10 @@ class BitmaskBackend(configurable.ConfigurableService): on_start(self.init_bonafide) on_start(self.init_sessions) - if self._enabled('mail'): + if HAS_MAIL and self._enabled('mail'): on_start(self._init_mail_services) - if self._enabled('vpn'): + if HAS_VPN and self._enabled('vpn'): on_start(self._init_vpn) if self._enabled('zmq'): |