summaryrefslogtreecommitdiff
path: root/src/mailman/app/lifecycle.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-09-04 21:31:50 -0400
committerBarry Warsaw2012-09-04 21:31:50 -0400
commit3c77c83ec4070e7183482445ff0b9a30398b72f4 (patch)
tree7d992c11114cc2e8cb1c22d65f517c1d1f5f201f /src/mailman/app/lifecycle.py
parent56c3bf127b5fb912461e638b6936c627d30be744 (diff)
downloadmailman-3c77c83ec4070e7183482445ff0b9a30398b72f4.tar.gz
mailman-3c77c83ec4070e7183482445ff0b9a30398b72f4.tar.zst
mailman-3c77c83ec4070e7183482445ff0b9a30398b72f4.zip
Diffstat (limited to 'src/mailman/app/lifecycle.py')
-rw-r--r--src/mailman/app/lifecycle.py22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/mailman/app/lifecycle.py b/src/mailman/app/lifecycle.py
index 5082034bc..326498478 100644
--- a/src/mailman/app/lifecycle.py
+++ b/src/mailman/app/lifecycle.py
@@ -89,23 +89,19 @@ def create_list(fqdn_listname, owners=None):
-def remove_list(fqdn_listname, mailing_list=None):
+def remove_list(mlist):
"""Remove the list and all associated artifacts and subscriptions."""
+ fqdn_listname = mlist.fqdn_listname
removeables = []
- # mailing_list will be None when only residual archives are being removed.
- if mailing_list is not None:
- # Remove all subscriptions, regardless of role.
- for member in mailing_list.subscribers.members:
- member.unsubscribe()
- # Delete the mailing list from the database.
- getUtility(IListManager).delete(mailing_list)
- # Do the MTA-specific list deletion tasks
- call_name(config.mta.incoming).create(mailing_list)
- # Remove the list directory.
- removeables.append(os.path.join(config.LIST_DATA_DIR, fqdn_listname))
+ # Delete the mailing list from the database.
+ getUtility(IListManager).delete(mlist)
+ # Do the MTA-specific list deletion tasks
+ call_name(config.mta.incoming).delete(mlist)
+ # Remove the list directory.
+ removeables.append(os.path.join(config.LIST_DATA_DIR, fqdn_listname))
# Remove any stale locks associated with the list.
for filename in os.listdir(config.LOCK_DIR):
- fn_listname = filename.split('.')[0]
+ fn_listname, dot, rest = filename.partition('.')
if fn_listname == fqdn_listname:
removeables.append(os.path.join(config.LOCK_DIR, filename))
# Now that we know what files and directories to delete, delete them.