summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-11-30 12:03:11 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-01-17 14:00:08 +0100
commitd377874c27b7cddb8c9f617b8b5c5352d43ae71d (patch)
tree24f801b25740eac8b6d843585d91974b394a2bee
parente8e33406d0bb0373fdbfb31f1e14a8dc93490059 (diff)
downloadpykolab-d377874c27b7cddb8c9f617b8b5c5352d43ae71d.tar.gz
Reconnect if setting quota fails
-rw-r--r--pykolab/imap/__init__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
index 046fdbd..a5f5f11 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -663,7 +663,15 @@ class IMAP(object):
log.debug(_("Value for user is not a dictionary"), level=8)
def set_quota(self, folder, quota):
- self.imap._setquota(folder, quota)
+ i = 0
+ while i < 10:
+ try:
+ self.imap._setquota(folder, quota)
+ i = 10
+ except:
+ self.disconnect()
+ self.connect()
+ i += 1
def set_user_folder_quota(self, users=[], primary_domain=None, secondary_domain=[], folders=[]):
"""