mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Don't miserably crash if doveadm fails to run
This commit is contained in:
parent
413778d2bc
commit
c9b2213817
1 changed files with 8 additions and 3 deletions
|
@ -467,9 +467,14 @@ def user_info(username):
|
||||||
elif username not in user_permission_list(full=True)["permissions"]["mail.main"]["corresponding_users"]:
|
elif username not in user_permission_list(full=True)["permissions"]["mail.main"]["corresponding_users"]:
|
||||||
logger.warning(m18n.n('mailbox_disabled', user=username))
|
logger.warning(m18n.n('mailbox_disabled', user=username))
|
||||||
else:
|
else:
|
||||||
cmd = 'doveadm -f flow quota get -u %s' % user['uid'][0]
|
try:
|
||||||
cmd_result = subprocess.check_output(cmd, stderr=subprocess.STDOUT,
|
cmd = 'doveadm -f flow quota get -u %s' % user['uid'][0]
|
||||||
shell=True)
|
cmd_result = subprocess.check_output(cmd, stderr=subprocess.STDOUT,
|
||||||
|
shell=True)
|
||||||
|
except Exception as e:
|
||||||
|
cmd_result = ""
|
||||||
|
logger.warning("Failed to fetch quota info ... : %s " % str(e))
|
||||||
|
|
||||||
# Exemple of return value for cmd:
|
# Exemple of return value for cmd:
|
||||||
# """Quota name=User quota Type=STORAGE Value=0 Limit=- %=0
|
# """Quota name=User quota Type=STORAGE Value=0 Limit=- %=0
|
||||||
# Quota name=User quota Type=MESSAGE Value=0 Limit=- %=0"""
|
# Quota name=User quota Type=MESSAGE Value=0 Limit=- %=0"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue