summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-02-05 02:41:22 +0100
committerThomas Bruederli <bruederli@kolabsys.com>2015-02-05 02:48:48 +0100
commit93eec46e37c37be27735d8a42e1bf36287594a14 (patch)
tree55a3f41af7ceac60dc1257bcece0f9ffe45b504b
parent8098ba5de5aa2b74dfacfddc6b82dd2f8601c581 (diff)
downloadpykolab-93eec46e37c37be27735d8a42e1bf36287594a14.tar.gz
Fix printing of quota update status (#4496)
-rw-r--r--pykolab/cli/cmd_set_quota.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/pykolab/cli/cmd_set_quota.py b/pykolab/cli/cmd_set_quota.py
index cbfd529..1d39056 100644
--- a/pykolab/cli/cmd_set_quota.py
+++ b/pykolab/cli/cmd_set_quota.py
@@ -17,6 +17,8 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
+import sys
+
import commands
import pykolab
@@ -54,14 +56,16 @@ def execute(*args, **kw):
imap = IMAP()
imap.connect(domain=domain)
+ # Verify the folder actually exists in IMAP
if not imap.has_folder(folder):
print >> sys.stderr, _("No such folder %r") % (folder)
-
- else:
- imap.set_quota(folder, quota)
+ sys.exit(1)
# See if the folder is an INBOX folder
# If yes, edit LDAP (through WAP client)
# If no, edit IMAP
- # Verify the folder actually exists in IMAP
+ for _folder in imap.lm(imap.folder_utf7(folder)):
+ imap.set_quota(_folder, quota)
+ print >> sys.stdout, "Quota for folder '%s' set to %d" % (_folder, int(quota))
+