summaryrefslogtreecommitdiffstats
path: root/cyruslib.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-06-13 16:43:03 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-06-13 16:43:03 +0100
commitc4bcedbe35e24fd8264cff077044f5309855fce3 (patch)
treeea3db493763b75eff8871cbb0d0c3ce6597919fc /cyruslib.py
parent968f53e040591fce8790cd0aba030f6f6810e758 (diff)
downloadpykolab-c4bcedbe35e24fd8264cff077044f5309855fce3.tar.gz
Failed or no quota should return None, not 0 (which is actually valid quota)
Diffstat (limited to 'cyruslib.py')
-rw-r--r--cyruslib.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/cyruslib.py b/cyruslib.py
index 20dd55b..f141059 100644
--- a/cyruslib.py
+++ b/cyruslib.py
@@ -572,11 +572,11 @@ class CYRUS:
match = re_q0.match(msg[0])
if match:
self.__verbose( '[GETQUOTA %s] QUOTA (Unlimited)' % mailbox )
- return 0, 0
+ return None, None
match = re_q.match(msg[0])
if match is None:
self.__verbose( '[GETQUOTA %s] BAD: RegExp not matched, please report' % mailbox )
- return 0, 0
+ return None, None
try:
used = int(match.group(2))
quota = int(match.group(3))
@@ -584,7 +584,7 @@ class CYRUS:
return used, quota
except:
self.__verbose( '[GETQUOTA %s] BAD: Error while parsing results' % mailbox )
- return 0, 0
+ return None, None
def lqr(self, mailbox):
"""List Quota Root"""
@@ -595,7 +595,7 @@ class CYRUS:
match = re_q0.match(msg[1][0])
if match:
self.__verbose( '[GETQUOTAROOT %s] QUOTAROOT (Unlimited)' % mailbox )
- return _root, 0, 0
+ return _root, None, None
match = re_q.match(msg[1][0])
try:
@@ -605,7 +605,7 @@ class CYRUS:
return _root, used, quota
except:
self.__verbose( '[GETQUOTAROOT %s] BAD: Error while parsing results' % mailbox )
- return _root, 0, 0
+ return _root, None, None
def sq(self, mailbox, limit):
"""Set Quota"""