diff options
author | Ruben Pollan <meskio@sindominio.net> | 2017-03-17 00:34:12 +0100 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2017-03-17 00:42:13 +0100 |
commit | 09bf881b4f457f731c5a49e88822bc731eda2c96 (patch) | |
tree | 1c164fd3381cfe68d05a5f09f7f52f3756615b5a /src/leap/bitmask/core | |
parent | 4fe2ad820ab46f522682bcaece55a400c7038378 (diff) |
[feat] report the real status of the VPN
Diffstat (limited to 'src/leap/bitmask/core')
-rw-r--r-- | src/leap/bitmask/core/mail_services.py | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/leap/bitmask/core/mail_services.py b/src/leap/bitmask/core/mail_services.py index 019a1048..70e7b490 100644 --- a/src/leap/bitmask/core/mail_services.py +++ b/src/leap/bitmask/core/mail_services.py @@ -47,7 +47,7 @@ from leap.bitmask.mail.imap import service as imap_service from leap.bitmask.mail.smtp import service as smtp_service from leap.bitmask.mail.incoming.service import IncomingMail from leap.bitmask.mail.incoming.service import INCOMING_CHECK_PERIOD -from leap.bitmask.util import get_gpg_bin_path +from leap.bitmask.util import get_gpg_bin_path, merge_status from leap.soledad.client.api import Soledad from leap.bitmask.core.uuid_map import UserMap @@ -599,30 +599,7 @@ class StandardMailService(service.MultiService, HookableService): 'keymanager': keymanager.status(userid), 'incoming': incoming_status } - - def key(service): - status = childrenStatus[service] - level = { - "on": 0, - "off": 1, - "starting": 10, - "stopping": 11, - "failure": 100 - } - return level.get(status["status"], -1) - - service = max(childrenStatus, key=key) - - status = childrenStatus[service]["status"] - error = childrenStatus[service]["error"] - - res = {} - for s in childrenStatus.values(): - res.update(s) - res['status'] = status - res['error'] = error - res['childrenStatus'] = childrenStatus - defer.returnValue(res) + defer.returnValue(merge_status(childrenStatus)) def get_token(self): active_user = self._active_user |