From b20010060a8ccc3443ccd50c37f2184db3f7ef21 Mon Sep 17 00:00:00 2001 From: Plamen Dimitrov Date: Thu, 12 Jul 2012 10:51:30 +0200 Subject: [PATCH] Main returns 0 or 1 depending on warnings number --- src/imap_restore_mail.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/imap_restore_mail.py b/src/imap_restore_mail.py index a6390e3..e5d684c 100644 --- a/src/imap_restore_mail.py +++ b/src/imap_restore_mail.py @@ -60,7 +60,7 @@ def main(): update_mailboxes(storage, session, args) logging.info("Finished injecting mails. Exiting with code %s.", warnings_handler.detected_problems) - return warnings_handler.detected_problems + return int(warnings_handler.detected_problems > 0) def update_mailboxes(storage, session, args): """Create new mailboxes if necessary and add acls to mailboxes if necessary.""" @@ -72,7 +72,7 @@ def update_mailboxes(storage, session, args): # add acls after all subfolders or their acls will be derived from parent folder for acl_mailbox in storage.acl_mailboxes: # find folder acls record and retrieve them - mb_acls = storage.get_mailbox_acls(acl_mailbox) + mb_acls = storage.get_mailbox_acls(acl_mailbox, args.ouser) session.add_acls(acl_mailbox, mb_acls, args.ouser, args.user) storage.created_mailboxes = [] storage.acl_mailboxes = [] -- 1.7.1